Forum Moderators: bakedjake
However, I just went to download the access logs of a specific site, and notice that each site has one - huge - access log file (on busy sites, the files is - gulp - over 1Go). On other servers, I'm used to seeing daily log files, and they're compressed. So obviously here is something I don't know how to do - I've looked on webmin and checked my handy-dandy "webmin book", but can't find how to set this up.
Can anyone help me on this one?
ok, I have found System / Log File Rotate
I see that I can set up a daily rotation, and have the old log files compressed. So far so good. If I set the "Number of old logs to keep" to 90, I guess that will limit the old log files the 3 months' worth. I assume the oldest ones are automatically deleted?
Is that pretty much it?
Do I have to add a line for each log file - two per site, for the access_log and the error_log - or can I run one commmande to rotate the 60 or so log files I now have accumulating?
[edited by: louponne at 11:08 pm (utc) on Feb. 21, 2005]
Have fun!
Here's my hacker log spec in httpd.conf:
(Note: 3 lines: LogFormat, SetEnvIf, and CustomLog)
====================================================
LogFormat "%a %{SID}e %l %u %t \"%r\" %>s %b \"%{Referer}i\"" hacklog SetEnvIf Request_URI \.ida¦\.exe¦\.dll¦OPTIONS¦CONNECT¦\.cfm¦\/race\/¦formmail¦FORMMAIL¦Formmail¦MSOffice¦\/ctruls\/¦\"¦<¦>¦XXXXX dolog CustomLog logs/hacker.log hacklog env=dolog Regardless, you _can_ set up logrotate to rotate your error logs. Just make entries for them, as the others.
I don't rotate mine, but then, they don't get very big unless there's a problem. (Typically I'll keep a close eye on the error logs for the first couple of weeks of a site installation, fixing errors as they appear, until there are hardly any errors....
Regardless, you _can_ set up logrotate to rotate your error logs. Just make entries for them, as the others.
syslogd -SIGHUP simply gets the log files going again, where apachectl restart does more, of course, but neither one has any effect on anything else (i.e. active sessions, etc.), so unless there's a problem with your httpd.conf that makes restarting Apache take a long time, either should do. I've got an older server that includes the Apache restart at the end of the script and a newer one that reinits syslogd, and they're both working fine.
Might as well stick with
apachectl restart, if that's what you already have in your cronjob script. (I do stand to be corrected if someone has any observations that modify my statements, above. :)