Rotate Log Files

The default installations of Apache will set this up using the logrotate script.  If you don’t have this configured automatically or if you’re using a non-standard installation (cPanel, Plesk, etc.) you can configure this in logrotate.

/etc/logrotate.d/httpd:

/path/to/httpd/logs/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -HUP `cat /path/to/httpd.pid 2>/dev/null` 2> /dev/null || true    endscript
}

Of course, update paths correctly and test appropriately.

Share on Twitter
Share on Facebook

BLACK

FRIDAY

DEALS

UP TO 60% OFF
Friday November 27th starts at 9am EST.
While supplies last!