I have had a webmin/virtualmin installation for quite some time, with a production VPS and hot backup VPS that gets bounced back and forth from VPS to VPS depending on uptime, etc.
I am trying to establish some semblance of order, and one of the problems I have run across is the disparity in access/error log location for virtual servers, and consequent “Log file rotation : No logrotate configuration found for file” errors. Even a restore from “working” production VPS doesn’t solve this problem.
Apparently there are two “possible/suggested” locations for those logs:
the “logs” directory of the virtual server, and
/var/log/virtualmin
I can see some compelling reasons for each, but can someone with a little more experience tell me:
Which is the current “commonly accepted” location and why/pros-cons?
Is there an “easy” way to make all virtual servers uniform once I decide?
a. Should I just edit the “/etc/logrotate.conf” file?
b. Or should I remove/re-add log rotation feature to each virtual server?
c. Do I need to change/fix a setting in Virtualmin/Webmin so all future Virtual Servers will use that location?
I just did a little test in this regard. I instructed VMin to use a different directory for domain logfiles by editing the server template section “Apache Website / Directives and settings for new websites”. Change the two lines
Log file rotation is also correctly set up for the changed location, just from this one change. I suppose the setup script analyzes the apache config file and looks for the ErrorLog and CustomLog directives.
All this applies to creating new servers.
As for changing existing servers: After manually modifying their apache config files (the template is not applied to existing domains, for obvious reasons), I guess it would be best to disable and re-enable the Logfile Rotation feature for all domains. Note that you can’t do that via the GUI but need to use the API command virtualmin disable-feature --logrotate --all-domains.
Do you (or anyone) have any insight into the pros/cons of a /var/log/virtualmin/(domain.tld)_access_log location versus a /home/(reseller account)/domains/(domain.tld)/log/access_log location?
Putting them in /var/log/virtualmin is the default now. It keeps things nice and simple, and makes it difficult for the user to accidentally delete them and cause problems. I’d suggest putting them in /var/log/virtualmin