Hello,
I have Apache installed/compiled from source in my server (*not* from RPM). In 
its httpd.conf, I specify so that it writes its log in /var/log/apache/logs/. 
The log files are access_log and error_log.

So I read the man page for logrotate, and thought to play around with it. I 
want the apache logs to be rotated, and I add these to my 
/etc/logrotate.conf:

# rotate apache logs (added by reubendb)
/var/log/apache/logs/access_log {
  rotate 5
  weekly
}

/var/log/apache/logs/error_log {
  rotate 5
  weekly
}

It seems that logrotate works fine. In my /var/log/apache/logs directory now I 
can see access_log, access_log.1, error_log, error_log.1, etc.

But apparently when the log files are rotated, apache keep writing to the old 
one. So right now my Apache still writes to access_log.2 and error_log.2. 
Both access_log and error_log are empty, and so are access_log.1 and 
error_log.1

This, I think, kinda make sense if Apache already opened the file and keep it 
open. logrotate changes the logname, but apache keep "refers" to the file 
itself. If I restart Apache, then it will write to access_log and error_log.

So my question is, how do I solve this problem?

Thanks a lot for any help.
RDB
-- 
Reuben D. Budiardja
Department of Physics and Astronomy
The University of Tennessee, Knoxville, TN
-------------------------------------------------
/"\  ASCII Ribbon Campaign against HTML    
\ /  email and proprietary format      
 X   attachments.
/ \
-------------------------------------------------
Have you been used by Microsoft today? 
Choose your life. Choose freedom. 
Choose LINUX.
-------------------------------------------------


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to