Maximum Virtualhosts per apache instance


When using a large number of Virtual Hosts, Apache may run out of available file descriptors (sometimes called file handles) if each Virtual Host specifies different log files. The total number of file descriptors used by Apache is one for each distinct error log file, one for every other log file directive, plus 10-20 for internal use. Unix operating systems limit the number of file descriptors that may be used by a process; the limit is typically 64, and may usually be increased up to a large hard-limit.

Does Virtualmin handle this issue? Do we have an option in Virtualmin to specify a common log file and split it before the stats are generated?


I’ve occasionally seen an issue with systems running out of available open files – when that happens, you can see in the Apache logs that it’s hitting an open file limit.

One workaround for that issue is to add this to the Apache init script:

ulimit -n 16384

Which bumps up the open file limit to 16384.