Apache2
| This article is not very long. You could help Gentoo-Wiki by editing this article. |
Contents |
[edit] 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.
[edit] Installation
For an Apache2 server you will need to emerge apache:
The directory of ROOT is in /var/www/localhost/htdocs/
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.
[edit] 00_mod_userdir.conf
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:
| Code: add to 00_mod_userdir.conf |
UserDir public_html UserDir disabled UserDir enabled user1 user2 root |
[edit] Starting the Apache2 Server
[edit] To add Apache to default runlevel (startup)
[edit] Configuration
Configuration files for server behavior and site definition(s) are kept in the /etc/apache2/ directory.
The configuration file for Apache's Init script is located at: /etc/conf.d/apache2. (This file is where you will add PHP, SVN and SSL support to the Web server.)
[edit] 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 vhost_alias 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.
[edit] See Also
- SSL Certificates
- SSL and Name Based Virtual Hosts
- APACHE2_MODULES: Briefly covers what each function the modules perform in the APACHE2_MODULES list.
- mod_vhost_alias: A module to make managing many vhosts easier.
- mod_perl: A Perl interface to Apache, making CGIs in Perl easier.
- mod_python: A Python interface to Apache making CGIs in Python easier.
- mod_security: A module which allows traffic analysis without any other infrastructural changes.
- Apache2/mod_authnz_external: A module which allows authentication with PAM or LDAP or other forms of authentication.
- PHP: A server side scripting language that many Web applications are built upon.
- Virtual Hosts