Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

From what i found on the web, "the way" to make Apache2 use rolling log files is to write a cron job that stop apache, rolls the log file, and starts it again.

Is there a saner way that doesn't force an apache shutdown?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

You didn't specify what operating system, so I'm going to assume you're on a Linux system. In CentOS, the logrotate "daemon" already has this written out for you. When it rotates the log, it uses the httpd reload command, which to my understanding does not exit the apache process, meaning no requests are rejected during that short interval. Try and look in /etc/logrotate.d/httpd for the rules. If that file doesn't exist, you can easily make one based off of any of the other rules you'll find in the logrotate.d folder.

share|improve this answer
    
Thanks - I'm using Ubuntu, and I found the config in /etc/logrotate.d/apache2 –  ripper234 Nov 7 '11 at 16:31
add comment

You can use Piped Logs as described here: Piped Logs

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.