HowTo: Reboot the Apache Server Safely
Posted by MickeyMouse in Apache web server
What do you do when you server freezes? This explains the safest steps for rebooting your apache webserver.
We’ve all been there. You try to access your site and nothing works. You can ping and login through your shell, but apache isn’t spitting out any info. Here is how to fix it.
Short Version:
- 1. Login as root
2. Try apachectl graceful
3. If doesn’t work, apachectl stop
4. ps -ef | grep http
5. apachectl start
Long Version:
- 1. Login and obtain root
2. Type in apachectl graceful and hit enter. This attempts to reboot apache “gracefully” and is the safest way to reboot the server.
3. Try to access your webserver again. If apache is truely locked, often the graceful restart will not work. Give it a minute or two and refresh the site to see if apache is spitting information again.
4. If graceful doesn’t work, then you’ll need to be a little rougher. Rebooting this way increases your risk of badness; however, if apache is frozen, you are not accessing much data anyway.
5. Type in apachectl stop and hit enter. This will most certainly bring apache completely down.
6. Type in ps -ef | grep http and hit enter.
You should see no httpd’s running which is ensure that apache is completely shutdown.
7. Type in apachectl start to restart the webserver again.
8. You can refresh your site and it should slowly come back up.
The Conversation
Follow the reactions below and share your own thoughts.



February 08, 2012 at 3:30 am, ashok babu said:
After stopping the apache webserver, if still httpd process are running , whwt we have to do?