[techtalk] Multiple virtual host question/Apache

Erin Clarke blue at web.net
Thu Oct 5 18:08:32 EST 2000


On Thu, Oct 05, 2000 at 01:59:29PM -0500, Yvonne Beever wrote:
> Is there a reasonable limit to the amount of virtual hosts one should
> run on a server? For example, we're up to 5 virtual hosts on one web
> server (using Apache) and are considering adding another.  One opinion
> has been voiced that the more you add, the easier it is for things to
> break. My boss also asked about the number of httpd daemons running...
> Someone here added more daemons to the server, he said, and he was
> wondering if there were limits...

The number of virtual hosts is largely limited by
system limits on the number of processes allowed to
run on the machine and on the system limit imposed 
on the number of file handles a child process can 
open (each virtual host opens 2 for access and error
log files, so 32 virtual hosts would use up a limit of
64, for example).

There are some options for controlling this in httpd.conf
with the following directives:
MaxClients, MaxRequestsPerChild, MaxSpareServers, 
MinSpareServers, StartServers.

See http://www.apache.org/docs/mod/directives.html
for more info on these and all other Apache directives.

The other consideration, which I think is among the 
opinions you've heard, is that a single httpd.conf for
a large number of sites is a single point of failure.

Errors in httpd.conf are usually human and not too 
difficult to find and fix, but it means *all* your
sites are 'down' while you troubleshoot, as opposed to
having multiple httpd.conf files (one for each site, 
but then you need IP addresses for each).

I have admined machines that run 100+ virtual hosts 
from one httpd.conf and it was fine. I currently admin
machines that run somewhat more and larger sites from 
individual httpd.conf files/processes...

For a small site with only 5 virtual hosts, I'm sure
one httpd.conf is ample and that you can fearlessly
add more virtual hosts, unless the machine is old and
seriously under-resourced or apache has to share 
resources on the machine with something big, like an 
oracle database (for example).

I recommend deciding on a standard virtual host config
and sticking with it, to reduce errors and confusion.

Erin  8)







More information about the Techtalk mailing list