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 logs not rotating

Discussion in 'EasyApache' started by ukagg, Jan 30, 2007.

  1. ukagg

    ukagg Active Member

    Joined:
    Aug 14, 2002
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    156
    Hi,

    /usr/local/apache/logs/access_log and /usr/local/apache/logs/error_log have grown too large on all my CentOS4.x servers. All other logs (except these 2) are rotating properly.

    I think, this is because there is no file named apache or httpd in /etc/logrotate.d/

    Can someone suggest how to fix it?

    Thanks
    UKA
     
  2. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    774
    Likes Received:
    4
    Trophy Points:
    318
    Location:
    N.W. Iowa
    here is a copy of the 'apache' file we used in the /etc/logrotate.d folder and works quiet well.
    Code:
    /usr/local/apache/logs/*_log {
    notifempty
    daily
    rotate 1
    missingok
    compress
    postrotate
    /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
    endscript
    }
    
    Mickalo
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. xerophyte

    xerophyte Well-Known Member

    Joined:
    Mar 16, 2003
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Canada
    you might need to use the
    Code:
    rotate 3 
    when you use rotate 1 its will only keep one log archive and above code rotate every day, if you wanna trouble shoot issues with access.log or something you might need few days of logs, so if you are using daily i would recommend to use 3+

    hope that helps
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    774
    Likes Received:
    4
    Trophy Points:
    318
    Location:
    N.W. Iowa
    this was just posted as a sample, may need to be adjusted for their own preferences!

    Mickalo
     
    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