Apache – starting/stoppingSee also Apache topics.
How to start/stop ApacheI wound up with a serious problem today, which could only be resolved with a reboot. For a description of that incident, please see httpd: could not bind to port 80 – how not to stop a process.
I was playing around with virtual websites, and I was stopping and starting httpd quite a lot. Unfortunately, I was not stopping it correctly.
The correct way to stop httpd is by issuing the following command:
To stop httpd, issue the following command:
For my system, the above files are located at /usr/local/sbin.
The above process allows active sessions to terminate normally. If you do a kill or a killall, you are defeating that process.
Restarting ApacheYou should not do a HUP on apache to restart it. Nor should you do a killall -HUP. See http://httpd.apache.org/docs/stopping.html for details. If you don’t use the following approach, you risk disconnection of existing clients and missed log file entries.
If you are restarting Apache (i.e. you have modified httpd.conf and want to invoke the changes), you should do this: