Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Apache error_log missing after logrotate

Discussion in 'EasyApache' started by tolouei, Dec 12, 2013.

  1. tolouei

    tolouei Member

    Joined:
    May 17, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    51
    After logrotate run, file /usr/local/apache/logs/error_log was missing.

    I found the problem: When logrotate run, error_log is compressed and moved to folder ./archive but new error_log was not created because logrotate cant restart apache service. Apache only create ou read new file after restart ou graceful command.

    Checking the file: /etc/logrotate.d/httpd

    I found the problem in line:

    /sbin/service httpd reload > /dev/null 2>/dev/null || true

    "reload" is not used anymore (im running apache 2.2.6, whm , cpanel all is updated with last stable version)

    I solved changing that line to:

    /sbin/service httpd graceful > /dev/null 2>/dev/null || true

    Is this correct?


    Thanks
     
    #1 tolouei, Dec 12, 2013
    Last edited: Dec 13, 2013
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,384
    Likes Received:
    1,951
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Thank you for updating this thread with the outcome. Note that LogRotate is a third-party application that is not managed by cPanel. You may want to have the Apache error_log managed by cpanellogd and have it rotated per the option in:

    "WHM Home » Service Configuration » Apache Configuration » Log Rotation"

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. tolouei

    tolouei Member

    Joined:
    May 17, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    51
    But Im using cpanellogd,

    whm + centos 6.5

    maybe I need to disable default logrotate from centos:

    chmod -x /etc/cron.daily/logwatch

    with this, only cpanellogd act. I think in this case system's logrotate act first then cpanellogd
     
    #3 tolouei, Dec 13, 2013
    Last edited: Dec 13, 2013
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,384
    Likes Received:
    1,951
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yes, you may want to consider disabling LogRotate if you want cPanel to manage the Apache error_log rotation.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice