Since the beginning of time, cPanel has had logs that it simply does not
rotate properly. Why this has been an ongoing problem that has never been fixed
is beyond me, but it CAN be fixed and we'll go through what is needed to
The most important logs that are missed are the Apache system logs that are
located in /usr/local/apache/logs. SSH into your server as root.
(on some servers this file is called apache)
The first line should read:
Also you need to change the line that reads:
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2>
/dev/null || true
/bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid
2>/dev/null` 2> /dev/null || true
(the above line should all be on ONE LINE!)
The next log file that needs to be dealt with is /var/log/xferlog. This is
your FTP transfer log.
This will create a new file. If you are running ProFTP, paste the following
snippet into this file:
postrotate /bin/kill -HUP `cat /var/proftpd.pid 2> /dev/null` 2> /dev/null ||
If you are running PureFTP then paste this into the file:
postrotate /bin/kill -HUP `cat /var/run/pure-ftpd.pid 2> /dev/null` 2> /dev/null
The next item we need to deal with is for any sites for which you have
installed SSL certificates for. If you have not installed any SSL certificates,
then you can skip this section. Any domain that you have installed an SSL
certificate for gets a log file for tracking SSL traffic and it is located in
/var/log. These are pretty simple to add.
Add an entry styled like the one below for each secure domain you have on
your server at the end of the file:
Take a look in /var/log to make sure that you have the proper filename i that
first line. It will match exactly as you have it set up in WHM.
One other stray log that cPanel ignores is /var/log/chkservd.log. Add this
section to the same file (/etc/logrotate.conf) that you were just editing:
To add insult to injury, cPanel is not rotating its own logs either. Place
this in the same file we have been editing: