Linux Dedicated server is generally provided with cPanel control panel. With the help of cPanel it is very easy to manage the server. It is a very good control panel with a lot of features. With many advantages, cPanel has some disadvantages as well. One of the disadvantage of cPanel control panel is that it consists of some logs which are quite troubling and they do not rotate properly. But you do not have to worry as they can be fixed. Follow the steps given below to fix this problem :

For fixing this problem you will have to login into your Linux Dedicated server as root.

The most important logs that are missed are the Apache system logs that are located in /usr/local/apache/logs.

pico /etc/logrotate.d/httpd
(on some servers this file is called apache)

The first line should read:

/usr/local/apache/logs/*log {

Also you need to change the line that reads:

/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true

to:

/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.

pico /etc/logrotate.d/ftp

This will create a new file. If you are running ProFTP, paste the following snippet into this file:

/var/log/xferlog {
postrotate /bin/kill -HUP `cat /var/proftpd.pid 2> /dev/null` 2> /dev/null || true
endscript
missingok
}

If you are running PureFTP then paste this into the file:

/var/log/xferlog {
postrotate /bin/kill -HUP `cat /var/run/pure-ftpd.pid 2> /dev/null` 2> /dev/null || true
endscript
missingok
}

If you have installed SSL certificates on any of your websites it will have log files which are created to track SSL traffic. These logs are present in /var/log. You will have to add these and it is quite simple to do this.

pico /etc/logrotate.conf

Add an entry styled like the one below for each secure domain you have on your server at the end of the file:

/var/log/securedomain.tld {
weekly
rotate 1
}

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:

/var/log/chkservd.log {
weekly
rotate 1
}

To add insult to injury, cPanel is not rotating its own logs either. Place this in the same file we have been editing:

/usr/local/cpanel/logs/stats_log {
weekly
rotate 1
}

/usr/local/cpanel/logs/access_log {
weekly
rotate 1
}

/usr/local/cpanel/logs/error_log {
weekly
rotate 1
}

These are the logs which are present and this should fix the problem.