Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Lets start with a small dump:

/var/log/httpd/*log {
        /sbin/service httpd reload > /dev/null 2>/dev/null || true

This is a dump of of our httpd logrotate.d file.

As you can see, after the files are rotated, apache is "reloaded".

Is it ok to disable this?

We reverse proxy (via nginx) to our apache boxes and have noticed when this is executed (httpd reload) there is 2-5 seconds of downtime (noticed as in, via our nginx reverse proxy logs).

We would like to disable this.

Any ideas how to rotate apache logs without sending a reload once they have been rotated?


share|improve this question
up vote 5 down vote accepted

You can use Apache's piped logs. You can write the piped stream to file yourself and handle the rotation inside the script. Apache does not need to be reloaded then.

share|improve this answer

The reason for the reload is that Apache opens the log file and gets a handle to it when started or reloaded. It will then continue writing to that file handle even if the file is moved, so if you are rotating the files by moving them, you will need to do a reload so it will realise the file is missing and create a new one with a new file handle.

Like Christopher Perrin said, using piped logs is one solution. Another is to use the option


in your logrotate config file. Instead of the log file being moved, it will be copied to its new place and the old file will be truncated. That means that Apache can keep the same filehandle, and doesn't need to be restarted.

share|improve this answer

Your Answer


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.