Apache: Graceful Server Reboot From Shell

by on January 27, 2009 · 0 comments· LAST UPDATED September 8, 2010

in , ,

How do I gracefully restart Apache web server from a shell prompt?

Use the following commands as root user. Login over ssh session.

Debian / Ubuntu Linux

Type the following command to gracefully restart Apache 2 web server under Debian / Ubuntu Linux:
apache2ctl graceful
OR
sudo apache2ctl graceful

Redhat / CentOS / RHEL / Fedora Linux

Type the following command as the root user:
apachectl -k graceful
OR
sudo apachectl -k graceful

How do I view graceful restart log?

Type the following command under CentOS / RHEL:
tail -f /var/log/httpd/error_log
OR type the following command under Debian / Ubuntu Linux:
tail -f /var/log/apache2/error.log
Sample outputs:

[Tue Oct 27 00:45:38 2009] [notice] Graceful restart requested, doing restart
[Tue Oct 27 00:45:38 2009] [notice] Digest: generating secret for digest authentication ...
[Tue Oct 27 00:45:38 2009] [notice] Digest: done
[Tue Oct 27 00:45:38 2009] [notice] Apache/2.2.3 (Red Hat) configured -- resuming normal operations
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: