Whole document tree ![]() Apache HTTP ServerStopping and Restarting ApacheThis document covers stopping and restarting Apache on Unix and Cygwin only. Windows users should see Signalling Apache when running. You will notice many To send a signal to the parent you should issue a command such as: You can read about its progress by issuing:kill -TERM `cat /usr/local/apache/logs/httpd.pid` Modify those examples to match your ServerRoot and PidFile settings.tail -f /usr/local/apache/logs/error_log As of Apache 1.3 we provide a script called apachectl which can be used to start, stop, and restart Apache. It may need a little customization for your system, see the comments at the top of the script. TERM Signal: stop nowSending the HUP Signal: restart nowSending the Users of the status module
will notice that the server statistics are set to zero when a
Note: If your configuration file has errors in it when you issue a restart then your parent will not restart, it will exit with an error. See below for a method of avoiding this. USR1 Signal: graceful restartNote: prior to release 1.2b9 this code is quite unstable and shouldn't be used at all. The This code is designed to always respect the MaxClients, MinSpareServers, and MaxSpareServers settings. Furthermore, it respects StartServers in the following manner: if after one second at least StartServers new children have not been created, then create enough to pick up the slack. This is to say that the code tries to maintain both the number of children appropriate for the current load on the server, and respect your wishes with the StartServers parameter. Users of the status module
will notice that the server statistics are not
set to zero when a The status module will also use a At present there is no way for a log rotation script using
Note: If your configuration file has errors
in it when you issue a restart then your parent will not
restart, it will exit with an error. In the case of graceful
restarts it will also leave children running when it exits.
(These are the children which are "gracefully exiting" by
handling their last request.) This will cause problems if you
attempt to restart the server -- it will not be able to bind to
its listening ports. Before doing a restart, you can check the
syntax of the configuration files with the Appendix: signals and race conditionsPrior to Apache 1.2b9 there were several race conditions involving the restart and die signals (a simple description of race condition is: a time-sensitive problem, as in if something happens at just the wrong time it won't behave as expected). For those architectures that have the "right" feature set we have eliminated as many as we can. But it should be noted that there still do exist race conditions on certain architectures. Architectures that use an on disk ScoreBoardFile have the
potential to corrupt their scoreboards. This can result in the
"bind: Address already in use" (after
All architectures have a small race condition in each child involving the second and subsequent requests on a persistent HTTP connection (KeepAlive). It may exit after reading the request line but before reading any of the request headers. There is a fix that was discovered too late to make 1.2. In theory this isn't an issue because the KeepAlive client has to expect these events because of network latencies and server timeouts. In practice it doesn't seem to affect anything either -- in a test case the server was restarted twenty times per second and clients successfully browsed the site without getting broken images or empty documents. Apache HTTP Server![]() |