rene123

Active Member
Feb 20, 2009
28
0
51
My apache logs under /usr/local/apache/logs (CentOS) does not rotate correctly. Sooner or later access_log, suexec_log or error_log grow to 2gb and then Apache crash and won't start. I do the rotating manually right now but it would be nice not to do that..

How do I solve this?
 

kuldeep_nikam

Member
Apr 10, 2010
6
0
51
cPanel provides feature to Configure log rotation.

Login to WHM as root and go to Main >> Service Configuration >> cPanel Log Rotation Configuration

Here you will see all option including error_log to rotate.
Check box the option as per your requirement and select save.

This will rotate all the logs that you have selected.

Hope this helps :)
 

rene123

Active Member
Feb 20, 2009
28
0
51
Yes I know, access_log is checked there but it does not rotate. Plus option for the suexec_log is not available there...
 
Last edited:

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
220
6
68
Indiana, USA
I would suggest opening a ticket if you have them set to rotate and they do not.

As far as the error_log - you could go through it and see what's causing it to build up and potentially resolve some of those issues to help resolve that as well.
 

xerophyte

Well-Known Member
Mar 16, 2003
215
0
166
Canada
cPanel provides feature to Configure log rotation.

Login to WHM as root and go to Main >> Service Configuration >> cPanel Log Rotation Configuration

Here you will see all option including error_log to rotate.
Check box the option as per your requirement and select save.

This will rotate all the logs that you have selected.

Hope this helps :)
I might be wrong, but i think above configuration only allow to rotate the /usr/local/cpanel/logs not apache logs in /usr/local/apache/logs

You can configure the logrotate to rotate the logs in /usr/local/apache/logs

take look at
/etc/logrotate.d/httpd for example
 

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
220
6
68
Indiana, USA
I rent my cPanel so that not possible for me...
You are on a VPS or Dedicated or Shared?

If you're on VPS or Dedicated you can definitely submit a ticket to cPanel.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
My apache logs under /usr/local/apache/logs (CentOS) does not rotate correctly. Sooner or later access_log, suexec_log or error_log grow to 2gb and then Apache crash and won't start. I do the rotating manually right now but it would be nice not to do that..

How do I solve this?
Did you enable rotation for the applicable Apache logs via WHM? Here is the correct WHM menu path: WHM: Main >> Service Configuration >> Apache Configuration >> Log Rotation

Please keep in mind that the aforementioned log rotation will only occur for logs that reach the configured threshold; by default this is for logs that are 300 MB in size or greater, as configured via the Tweak Settings page in WHM: WHM: Main >> Server Configuration >> Tweak Settings >> Stats and Logs
  • Threshold in megabytes above which cpanellogd will rotate log files configured for log rotation. (Minimum 10MB)

If there is still difficulty, please check to ensure the system is updated to the latest cPanel build and version as seen via the following resource: http://httpupdate.cpanel.net/#builds