Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

It seems so "primitive" that HTTPD has to be restarted just to rotate the logs. There has got be other ways to accomplish this!

Note that I do not use nor wish to use AWStats, one of the ways to solve this problem.

Using CentOS 5.x on a dedicated server.

share|improve this question
You don't need to restart apache to rotate the logs. According to this, you need only send a SIGHUP to the PID listed in the PidFile, and apache will close and reopen its logfiles. – Steven Monday Sep 22 '11 at 15:43
What are you using to rotate your logs?? logrotate should take care of this for you... – Sean Kimball Sep 22 '11 at 15:55
Would a reload be better than a SIGHUP ? – Gaia Sep 22 '11 at 18:41
up vote 6 down vote accepted

No need to restart, reload is enough:

/sbin/service httpd reload > /dev/null 2>/dev/null || true
share|improve this answer
I have "/etc/rc.d/init.d/httpd graceful ; sleep 5" Can I just replace it with the line above? – Gaia Sep 22 '11 at 18:40
reload send a HUP signal to the process. graceful, as its mean, doesn't terminate the currently open connections. A side effect is the old log files will not be closed immediately. – quanta Sep 23 '11 at 2:11

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.