How to gracefully restarting the Apache httpd daemon

ApacheToday i received an email from our customer said that they do not know how to restart the Apache Web Server graceful. Restarting Apache Web Server also known as gracefully restarting the Apache httpd daemon.

Gracefully restarting httpd daemon will ensures that existing processes are allowed to finish serving the current page. Besides, it will reduce the chance of disrupting a user’s browsing experience.

How do i gracefully restart Apache Web Server?

To gracefully restart Apache web server. Please enter following command as the root user:-

Under Debian / Ubuntu Linux

apache2ctl graceful

Under RedHat / Centos / Fedora Linux

apachectl -k graceful

How do I verify that my Apache Web Server gracefully restart?

To verify your Apache Web Server gracefully restart, you can the Apache Web Server log files.

To view the logs, type the following command under CentOS / RHEL:

tail -f /var/log/httpd/error_log

For Debian / Ubuntu Linux, enter the following command:

tail -f /var/log/apache2/error.log

The output of the log file detail will show as below:-

Mon Jun 03 17:34:51 2013] [notice] Graceful restart requested, doing restart
[Mon Jun 03 17:34:51 2013] [notice] Digest: generating secret for digest authentication …
[Mon Jun 03 17:34:51 2013] [notice] Digest: done
[Mon Jun 03 17:34:51 2013] [notice] Apache/2.2.3 (CentOS) configured — resuming normal operations

Leave a Reply

Your email address will not be published. Required fields are marked *