Save 15% on Instant Deploy Bare-Metal Servers in 26 Global Markets with Coupon Code: EdgeSave

Rotate Log Files for Cpanel Plesk etc

Solution

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