Alternate Ways of Stopping Apache


# kill HUP 25297 # kill 9 25297


Sometimes it is necessary or convenient to signal the server directly using the kill command-line utility instead of the apachectl wrapper script. To do this, first find the process id of the running Apache server using ps or lsof as shown . Then, end the process with the kill command-line tool, supplying the signal to be sent as the first argument and the Apache server's process id (25297 in this example) as the second argument. Use HUP as the signal to stop the server or SIGHUP as the signal to restart the server. You can also replace the signal with its numerical equivalent, as shown in the example. Read the kill manual page for details.

In Linux, you can send a signal to all processes named httpd with the killall command. For example, you can kill all httpd processes using

# killall HUP httpd


You need to be careful, because if you are running several Apache instances, this command will take them all down!

Note that you need to have the appropriate permissions for these commands to work. In nearly all cases, you must either be the superuser or the owner of the Apache process in order to end or restart it.

In Windows systems, you can force Apache to stop by using the Windows Task Manager and pressing the End Task button.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net