The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Apache - starting/stopping 22 October 1998
Need more help on this topic? Click here
This article has 1 comment
Show me similar articles
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:

./apachectl start

To stop httpd, issue the following command:

./apachectl stop

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 Apache
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:

/usr/local/sbin/apachectl graceful

Need more help on this topic? Click here
This article has 1 comment
Show me similar articles