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.

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:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. tolouei

    tolouei Member

    Joined:
    May 17, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page