Stopping and restarting Apache httpd cleanly
Archive - Originally posted on "The Horse's Mouth" - 2006-03-29 05:18:48 - Graham EllisIf you'r running an Apache httpd server and you need to restart it, then you may be used to running:
apachectl stop
apachectl start
and in close succession, those should cause only a minor blip in service of perhaps a second or two; the sort of thing that can be put down to a "sticky internet". But you can do better
apachectl restart
Runs a configuration test before it stops the old daemon so that if you've editied your configuration file and introduced a fatal error, it won't go ahead with the stop. It also means that the restart is at electronic speed after the stop, curtting the blip. But you can do better
apachectl graceful
Runs the configuration test, AND allows currently open connections to be concluded before rebooting - thus ensuring that no-one gets a partial page as you cycle your httpd.
Note - if you have allowed per-directory changes to the configuration via .htaccess files, then you don't need to restart the server in any way when they're changed - they are checked at every web site "hit".