Rotate Log Files for Plesk

⌘K
  1. Home
  2. Docs
  3. Control Panel
  4. Plesk
  5. Rotate Log Files for Plesk

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.