# Any manual to install apache, php, mysql on gentoo?

## rado3105

Hi I have problem install this tree things. I cant find any good manual to show me installation on gentoo. And wiki mannuals doesnt work. Can you help, please?

in  /etc/apache2/httpd.conf there are no directives, I dont know if there is also another config file for apache?

----------

## alex.blackbit

installing applications on gentoo is done with the emerge command, but apparently you already know that since you seem to have apache installed.

what exactly is wrong with /etc/apache2/httpd.conf? i isn't very long, because most things in apache 2.2 are done in so called "modules". the configs for those are included with the line

```
Include /etc/apache2/modules.d/*.conf
```

which you should have too.

so, take a look at the directory /etc/apache2/modules.d/, i guess you will find there what you are looking for.

the definition of virtual hosts is done with files in the directory /etc/apache2/vhosts.d. you should have 

```
# Virtual-host support

#

# Gentoo has made using virtual-hosts easy. In /etc/apache2/vhosts.d/ we

# include a default vhost (enabled by adding -D DEFAULT_VHOST to

# APACHE2_OPTS in /etc/conf.d/apache2).

Include /etc/apache2/vhosts.d/*.conf
```

in your httpd.conf.

what problems do you have with mysql and php?

----------

## cach0rr0

-set your USE flags to include everything you need to be built into PHP (e.g. gd, curl, imap, mysql, and so on)

-make sure your USE also includes apache/apache2 (i forget which it is these days)

-would recommend having "-cli" in your USE

-from there, simply emerge dev-lang/php

-edit /etc/conf.d/apache2 and add -D PHP5 to apache opts

-run dispatch-conf, and for everything do u to *nuke* your old .conf, and use the new default

WARNING: that option with dispatch-conf will, of course, blow away your apache settings. If you're doing a new install, this is recommended. Obviously, if this is an existing/production install, this is a bad idea

The above should pull down apache2.2, mysql, and php, as well the .conf should already be loading the proper modules

Once that's done, do the emerge --configure =blah/mysql as the build log suggests, set up your password

set your OPTS

edit httpd.conf and vhosts.d/*.conf to your liking

and Bob's your uncle 

Point being, if it's a new install, simply having your USE set properly, emerging dev-lang/php, and then adding -D PHP5 to your OPTS is typically sufficient, since (as shown above) all modules are included by default

----------

## rado3105

please could anybody tell me ideal USE for PHP, APACHE2, MYSQL?

I found this, but not sure:

```
apache2 curl dba exif expat gd mysql pcre php vhosts xml
```

but not sure, if those are needed:

```
dba, exif, expad, gd,  xml, 
```

or are any other needed?

I still could not find any good manual how to install LAMP on gentoo, I found some for other linuxes(ubuntu...), but those are pretty different. And there is big shame that gentoo.wiki doesnt work.

----------

## alex.blackbit

if you are searching for a easy way to get information about use flags, install app-portage/euses.

nobody can suggest which use flags you need, you can only know yourself.

it is only natural that you do not find manuals on how to install this LAMP on gentoo, because you shouldn't do it.

the gentoo wiki is actually a quite useful thing, but it is not run by gentoo itself and the guy who runs it seems to have some trouble right now.

----------

## rado3105

Why I shouldnt install LAMP on gentoo?

----------

## nativemad

because there is no generic LAMP in gentoo!   :Wink: 

It always depends on your needs! 

If you need ldap, then ldap should be in your useflags... j

Just check with an "emerge -aDv apache php mysql" and you can see all useflags...

if have for example also ctype cgi imagemagick latin1 ldap sessions simplexml sockets sqlite threads xml and some more!  :Wink: 

You could enable all, or none of them...  Whatever you like!  :Razz: 

Cheers

----------

## alex.blackbit

 *rado3105 wrote:*   

> Why I shouldnt install LAMP on gentoo?

 

i already tried to explain that more than once. it is not the gentoo way of installing software.

webservers, databases and scripting languages are all available through portage, the gentoo package distribution system and are ready for installation.

of course it would be possible to install such a precompiled combined package, but it does not make sense.

you cannot affect which options of the applications are available and which are not.you do not get updates for those packages through the package distribution system of the distribution (portage).the applications are not optimized for your environment (which is the philosophy of gentoo)

----------

## cach0rr0

The main point they're trying to stress - which is fair enough - is that ideally, you sit and dig through the USE flags to find out what all you will need support for. 

Though having said that, I wipe my box and do a fresh gentoo install every few years...and every time, I end up re-emerging php at least a half dozen times because I've forgotten to set my USE flags to include support for something I need. 

They are trying to save you that pain by advising you to find out what all you need up front. Personally, I don't mind rebuilding php a number of times. 

If you don't mind the prospect of rebuilding PHP if you later find out you've omitted something you need, then

```

apache2 curl dba exif expat gd mysql pcre php vhosts xml

```

is a good starting point...

The only one in there I'd tend to steer clear of is vhosts

I personally like configuring my different lil webapps by hand. The vhosts USE flag, as I understand it, affects the manner in which such webapps (such as a CMS) are handled if you install them via Portage - I don't install these via portage. Just a personal preference. 

If I've said something wrong, hopefully someone else with more knowledge than myself will jump in and advise accordingly - but alas that's my two cents on it.

----------

