Is this the version you want? For more recent versions, check our documentation index.
www.serve.com which
provides Web space for several organizations including, say,
smallco and baygroup. Ordinarily, these
groups would be given parts of the Web tree on www.serve.com.
So smallco's home page would have the URL
http://www.serve.com/smallco/and baygroup's home page would have the URL
http://www.serve.com/baygroup/
For esthetic reasons, however, both organizations would rather their home pages appeared under their own names rather than that of the service provider's; but they do not want to set up their own Internet links and servers.
Virtual hosts are the solution to this problem. smallco and
baygroup would have their own Internet name registrations,
www.smallco.com and www.baygroup.org
respectively. These hostnames would both correspond to the
service provider's machine (www.serve.com). Thus smallco's home
page would now have the URL
http://www.smallco.com/and baygroup's home page would have the URL
http://www.baygroup.org/
Use multiple daemons when:
BindAddress www.smallco.com
This hostname can also be given as an IP address.
<VirtualHost www.smallco.com>
ServerAdmin webmaster@mail.smallco.com
DocumentRoot /groups/smallco/www
ServerName www.smallco.com
ErrorLog /groups/smallco/logs/error_log
TransferLog /groups/smallco/logs/access_log
</VirtualHost>
<VirtualHost www.baygroup.org>
ServerAdmin webmaster@mail.baygroup.org
DocumentRoot /groups/baygroup/www
ServerName www.baygroup.org
ErrorLog /groups/baygroup/logs/error_log
TransferLog /groups/baygroup/logs/access_log
</VirtualHost>
This VirtualHost hostnames can also be given as IP addresses.
Almost ANY configuration directive can be put in the VirtualHost directive, with the exception of ServerType, User, Group, StartServers, MaxSpareServers, MinSpareServers, MaxRequestsPerChild, BindAddress, PidFile, TypesConfig, and ServerRoot.
SECURITY: When specifying where to write log files, be aware of some security risks which are present if anyone other than the user that starts Apache has write access to the directory where they are written. See the security tips document for details.
Although Apache attempts to increase the limit as required, this may not work if:
#!/bin/sh
ulimit -S -n 100
exec httpd
csh script wrapper around httpd which
sets the "rlimit" to some large number, like 512.
struct rlimit rlp;
rlp.rlim_cur = rlp.rlim_max = 512;
if (setrlimit(RLIMIT_NPROC, &rlp)) {
fprintf(stderr, "setrlimit(RLIMIT_NPROC) failed.\n");
exit(1);
}
(thanks to "Aaron Gifford <agifford@InfoWest.COM>"
for the patch)