Virtual Server Access and Error log file locations

4 posts / 0 new
Last post
#1 Tue, 10/19/2010 - 11:21
Acorp

Virtual Server Access and Error log file locations

Hello,

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: 1) the "logs" directory of the virtual server, and 2) /var/log/virtualmin

I can see some compelling reasons for each, but can someone with a little more experience tell me: 1) Which is the current "commonly accepted" location and why/pros-cons? 2) 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?

Thanks in advance!

  • Acorp

www.acorp.net

Tue, 10/19/2010 - 12:39
Locutus

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

ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined

to your liking there.

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.

Wed, 10/20/2010 - 22:55 (Reply to #2)
Acorp

Thanks Loctus, worked like a charm.

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?

TIA.

  • Acorp

www.acorp.net

Wed, 10/20/2010 - 23:33
andreychek

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 :-)

-Eric

Topic locked