Apache

The Apache HTTP Server is a efficient and extensible web server and the most popular on the Internet.

Installation
Portage knows the global USE flag apache2 for enabling support for Apache in other packages. Enabling this USE flag will pull in automatically:

The USE flags of apache are:

After setting this you want to update your system so the changes take effect:

Configuration
Add Apache to the default runlevel:

Start the Apache server:

Testing
Verifying IP interfaces and ports on which apache2 is running on and listening to:

Testing if a connection to a Apache server is working on localhost:

Interrupt the connection test with + and.

PHP support
Install PHP with enabled apache2 USE flag and enable the PHP module by adding -D PHP{version}. (ie. -D PHP5; Note the suffixed version number is appended to the module name.)

Restart the Apache service:

To test, if the PHP module works, create a test page:

Now open the test page: http://localhost/

Troubleshooting

 * Troubleshooting guide

External resources

 * Slicehost article: Installing Apache on Gentoo
 * Slicehost article: Apache configuration files on Gentoo
 * Slicehost article: Configuring the Apache MPM on Gentoo
 * Slicehost article: Apache configuration on Gentoo
 * Slicehost article: Apache Virtual Hosts on Gentoo
 * Slicehost article: Enabling and using apache's mod_status on Gentoo
 * apache.org documentation