|
Apache HTTP Server Version 2.0 ![]() Stopping and RestartingThis document covers stopping and restarting Apache on Unix-like systems. Windows NT, 2000 and XP users should see Running Apache as a Service and Windows 9x and ME users should see Running Apache as a Console Application for information on how to control Apache on those platforms. See alsoIntroductionIn order to stop or restart Apache, you must send a signal to
the running To send a signal to the parent you should issue a command such as:
The second method of signaling the After you have signaled
Modify those examples to match your Stop Now
Sending the Graceful Restart
The On certain platforms that do not allow
USR1 to
be used for a graceful restart, an alternative signal may be used (such
as WINCH). The command apachectl graceful
will send the right signal for your platform.This code is designed to always respect the process control
directive of the MPMs, so the number of processes and threads
available to serve clients will be maintained at the appropriate
values throughout the restart process. Furthermore, it respects
Users of the The status module will also use a At present there is no way for a log rotation script using
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
-t
command line argument (see httpd). This still will not
guarantee that the server will restart correctly. To check the
semantics of the configuration files as well as the syntax, you
can try starting httpd as a non-root user. If there are no
errors it will attempt to open its sockets and logs and fail
because it's not root (or because the currently running httpd
already has those ports bound). If it fails for any other
reason then it's probably a config file error and the error
should be fixed before issuing the graceful restart.Restart Now
Sending the Users of 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 above for a method of avoiding this.
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 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. |
|
This apache manual Copyright © 1999-2003, The Apache Software Foundation.
Web Design Copyright © 1999-2003. Chrisranjana Software Solutions Pvt Ltd. syndicate rss feed |