Apache2

Summary
This is the index for all articles related to Apache 2. Apache 2 is a HyperText Transfer Protocol daemon. HTTP is the backbone of the Web. For further information on the history of Apache and other trivial data, visit The Apache HTTP Server Project page.

Typical installation
For an Apache2 server you will need to emerge apache:

The directory of ROOT is in /var/www/localhost/htdocs/

Allowing users to have their own webpages
In case you want to allow the users to have their own webpages (public_html), then do:

After that you also need to edit the file /etc/conf.d/apache2 and add "-D USERDIR" to APACHE2_OPTS as shown:

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D USERDIR"

Then every user has to make a public_html directory in order to put his/her index.html and any other files in there.

If you want to allow just some users to have their own web pages, then you have to edit the userdir module in:

/etc/apache2/modules.d/00_mod_userdir.conf

and add to it the following lines:

add to 00_mod_userdir.conf

Configuration
Configuration files for server behavior and site definition(s) are kept in the directory.

The configuration file for Apache's Init script is located at:. (This file is where you will add PHP, SVN and SSL support to the Web server.)

Serving more than one site from a single server
You're looking to do virtual hosts if you're looking to serve more than one site. Enable the APACHE2_MODULES flag to build support for virtual hosts. There are two styles of virtual hosts you can use: IP-based and name-based. Name-based virtual hosts are pretty much what everyone will want to use. See the Virtual Hosts subpage for more details.