The FreeBSD Diary
Providing practical examples since 1998If you buy from Amazon USA, please support us by using this link.
Apache - starting/stopping 22 October 1998
|See also Apache topics.
How to start/stop Apache
|I 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.
|You 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: