
138
|
Chapter 6: Administering Apache
PHP Module-Specific Directives
PHP directives may be placed in PHP’s own configuration file (/etc/php4/apache2/
php.ini), or in Apache configuration files. Normally you don’t need to deal with
them unless you install a PHP extension module or want to modify where PHP
searches for libraries or tweak security settings (such as safe mode). The normal
Apache modules have configuration files with a .conf suffix, located under /etc/
apache2/mods-enabled.
Virtual Hosts
Although you could devote an Apache server to a single site, you’ll probably want to
handle more than one site. Apache calls these virtual hosts, and it has more than one
way to specify them. When a web client contacts a web server via HTTP, it sends the
destination IP address and (in HTTP 1.1, the current web protocol standard) the
name of a server at that address.
In the default Apache setup, there are no independent virtual hosts. Apache will hap-
pily serve web pages no matter how many names the server has, and all domain
names share the same configuration.
In the following examples, let’s assume we want to house each site in its own direc-
tory under /var/www/vhosts.
IP-based virtual hosts
If you have more than one IP address on your server and want to dedicate certain
addresses to certain sites, you may choose to use IP-based (or address-based) virtual
hosts:
<VirtualHost 192.168.6.1>
ServerName "www1" ...