without CustomLog directive in VirtualHost

To safe open file descriptors, my VirtualHosts don’t have their own ErrorLog and CustomLog. All logs from the web-nodes are aggregated in one location and symlinked in the users homedir. But the Apache bandwidth monitoring in Virtualmin searches for these directives and won’t work without them.

I think I have two options:

  1. Make Virtualmin skip the check altogether and always use the correct access_log path
  2. Add the directive to the config, but in a way that Apache doesn’t handle it (how?)

My question is: does anyone ever handled this kind of problem before?


Yeah, Virtualmin would need to be able to see the individual logfiles in order to determine bandwidth usage.

Are you saying that what you have is one single logfile, that contains the access logs for all your Virtual Servers? As I’m not sure that as of today, Virtualmin could pull accurate bandwidth usage info out of that… at the moment, Virtualmin assumes each access log belongs solely to one domain.


Thanks for your reply. No, this is my current configuration:

webserver1 logs to local files with vlogger (one per domain)
webserver2 logs to local files with vlogger (one per domain)
webserverN logs to local files with vlogger (one per domain)

log-server rsyncs all logs from servers and combines the logs per domain into one log

This aggregated logfile per domain is symlinked into the users home directory.

Because all logging is done by a central vlogger process, the VirtualHosts don’t have their own CustomLog directives. But my setup does provide Virtualmin with one logfile per domain, which I can’t use without modifying the Vitrualmin source :slight_smile:

Okay, I think I understand now.

What if I twist your question around into a question of my own? :slight_smile:

See, I don’t know of a good way to solve the specific issue you’re asking about.

However, do you really need to save open file descriptors?

I’ve run into issues with the default open file limits when I’ve had too many logfiles open at once. Rather than coming up with a new logging scheme, I just bumped up the open files limit.

On many distros, you can do that by editing /etc/security/limits.conf, and setting the “nofile” limit for your Apache user to something higher. If that’s not working, you could always modify your Apache init script to call ulimit with the modified files limit.

There’s some examples of tuning all that here:

So I guess I’m wondering if tuning the files limit is an option in your case.