The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Howcome there is no option to place suexec_log into log rotation?

Discussion in 'General Discussion' started by gotroot, Sep 8, 2008.

  1. gotroot

    gotroot Active Member

    Joined:
    Mar 27, 2007
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    I mean, ours was reaching 2gb. Is there a reason why this was left out of the log rotation option in WHM? Seems like this is a fairly important oversight.

    Believe it or not, this is the 3rd largest log file on our boxes.
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    log rotation has been like this on a cpanel server since the beginning of time.
    despite many bugzilla reports reports I guess since log rotation is not really a cpanel task but a server task it up to you

    Just edit your /etc/logrotate.conf

    and add under

    # system-specific logs may be also be configured here.


    /usr/local/apache/logs/suexec_log {
    weekly
    rotate 4
    }


    #you might want to add these (they are likly not being rotated either)

    /usr/local/apache/logs/access_log {
    weekly
    rotate 4
    }

    /usr/local/apache/logs/error_log {
    weekly
    rotate 4



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



    # seems they added a log rotation feature in WHM for cpanel logs when did they do that :)
     
    #2 dalem, Sep 9, 2008
    Last edited: Sep 9, 2008
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    cpanellogd should be rotating that once it is larger than 300 MB. What is your full cPanel version number?
     
  4. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The rotatelogs function in cpanellogd will rotate certain system logs, one of which being /usr/local/apache/logs/suexec_log. You can examine the function yourself. It starts on line 750 of /usr/local/cpanel/cpanellogd

    Code:
    sub rotatelogs {
        my ($logsize);
        my $didtruncate = 0;
        my @LOGS        = qw( /usr/local/apache/logs/suexec_log
          /usr/local/apache/logs/ssl_engine_log
          /usr/local/apache/logs/access_log
          /usr/local/apache/logs/error_log
          /usr/local/apache/logs/mod_jk.log
          /usr/local/apache/logs/referer_log
          /usr/local/apache/logs/agent_log
          /usr/local/apache/logs/ssl_log
          /usr/local/apache/logs/suphp_log
          /usr/local/apache/logs/ssl_data_log
          /etc/httpd/logs/error_log
        );
    
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    To ease confusion, please elaborate how you feel cpanellogd which handles /usr/local/apache/logs/suexec_log log rotation (shown above by a member of our QA staff) is irrelevant to a discussion about /usr/local/apache/logs/suexec_log (presumably the suexec_log referred to in the original post) not being properly rotated. Thanks.
     
  6. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    I stand corrected (but mine never rotates either)
     
    #6 dalem, Sep 9, 2008
    Last edited: Sep 9, 2008
  7. vikins

    vikins Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    93
    Likes Received:
    1
    Trophy Points:
    8
    Can I just ask why 300 MBs? If you add up all the logs at 300 MB each that is a lot of wasted space. Why can't it just work like "/usr/sbin/logrotate /etc/logrotate.conf" but use the WHM gui for configuration instead of coming up with an off the wall and seemingly arbitrary scheme?

    :confused:

    Also, will "/var/log/chkservd.log" rotation be available through WHM at some point?

    Thanks
     
    #7 vikins, Jan 19, 2009
    Last edited: Jan 19, 2009
  8. vikins

    vikins Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    93
    Likes Received:
    1
    Trophy Points:
    8
    I wasn't trying to be snide, I really was looking for a comment on this. Any reason for the ridged 300 MB threshold?

    :)
     
  9. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi, those are the logs being rotated by the cPanel Log Rotation Configuration function at WHM, right? I don't understand why are present in the array two error_log locations (marked in bold), and how are they being handled? since this screen in WHM only shows one error_log checkbox: are they being merged in one gzipped file? Some clarification about this would be nice.
    Thank you
     
  10. internetfab

    internetfab Well-Known Member
    PartnerNOC

    Joined:
    Feb 20, 2003
    Messages:
    336
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Gothenburg, Sweden
    cPanel Access Level:
    DataCenter Provider
    Well I guess we have a faulty cpanel installation then, since suphp_log just hit 2GB and cpanellogd is running..

    Can't say I've seen these logs being rotated ever on any of our servers.
     
  11. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    This changed in cPanel 11.24 Rather than automatically rotating logs, you need to configure which logs you want rotated. You can set these in

    WHM >> Service Configuration >> Apache Configuration >> Log Rotation
    WHM >> Service Configuration >> cPanel Log Rotation
     
  12. internetfab

    internetfab Well-Known Member
    PartnerNOC

    Joined:
    Feb 20, 2003
    Messages:
    336
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Gothenburg, Sweden
    cPanel Access Level:
    DataCenter Provider
    Ah alright. That clears it all up. Thanks, will give it a shot.
     
  13. djmerlyn

    djmerlyn Well-Known Member

    Joined:
    Aug 31, 2004
    Messages:
    203
    Likes Received:
    1
    Trophy Points:
    16
    This only covers /usr/local/cpanel/logs folder though, not /usr/local/apache/logs (or any other folder for that matter).

    There is no error_log/access_log/suphp_log rotation for apache. You have to manually configure logrotate.conf which isn't terribly difficult, just another step in configuring a cpanel server.
     
  14. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Your information about logrotate.conf is correct.

    Your information about WHM >> Service Configuration >> Apache Configuration >> Log Rotation is incorrect. That interface allows you to specify rotation for any log file in /usr/local/apache/logs
     
  15. djmerlyn

    djmerlyn Well-Known Member

    Joined:
    Aug 31, 2004
    Messages:
    203
    Likes Received:
    1
    Trophy Points:
    16
    ahaha, I looked there so many times, finally now I see it.

    Whats weird that I noticed while configuring logrotate though, is that I have never configured error_log nor access_log because they "appear" to already be being rotated by something.

    Is that rotation not part of the error and access log accounting for users? And if I enable rotation on those logs won't I be disturbing the rotation of users logs that they have access to (domlogs et al)? I've never rotated them and they've never grown out of control, maybe I'm just lucky but they look like they're being rotated already with no known configured intervention.

    Thanks!
     
  16. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The domain access logs are handled separately. Use the Statistics Software Configuration interface in WHM to configure the processing interval for those logs. There are also some Tweak Settings that govern such.

    As mentioned, the Log Rotation interface in the Apache Configuration section of WHM only governs rotation of logs in /usr/local/apache/logs If the file is not in that directory then it will not be governed by the settings in Apache Configuration >> Log Rotation.
     
  17. internetfab

    internetfab Well-Known Member
    PartnerNOC

    Joined:
    Feb 20, 2003
    Messages:
    336
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Gothenburg, Sweden
    cPanel Access Level:
    DataCenter Provider
    Hey!

    I need to make the adjustments for log rotation on all of our servers - can it be done through /scripts/ or API yet?
     
  18. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you enable log rotation for all logs (both on the cPanel log rotation screen and the Apache log rotation screen) and do a ls -l in /var/cpanel/log_rotation, you will see what symlinks need to be set up for log rotation to be enabled. Remove the symlink to remove log rotation.

    cPanel logs are only prefixed with cp_

    Apache logs are prefixed with cp__apache__
     
  19. internetfab

    internetfab Well-Known Member
    PartnerNOC

    Joined:
    Feb 20, 2003
    Messages:
    336
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Gothenburg, Sweden
    cPanel Access Level:
    DataCenter Provider
    Thank you David!
     
Loading...

Share This Page