ukagg

Active Member
PartnerNOC
Aug 14, 2002
35
0
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
 

mickalo

Well-Known Member
Apr 16, 2002
782
5
318
N.W. Iowa
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
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
 

xerophyte

Well-Known Member
Mar 16, 2003
215
0
166
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
 

mickalo

Well-Known Member
Apr 16, 2002
782
5
318
N.W. Iowa
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
this was just posted as a sample, may need to be adjusted for their own preferences!

Mickalo