Howto Restart Apache Graceful

Apache Add comments
302

Sometimes when changing settings in your Apache config, adding virtual hosts and so on it’s needed to reload/restart the Apache daemon. Usually this is done with:

/etc/init.d/apache2 restart

But there two big disadvantages using this method:

  1. If your config is invalid, Apache will shutdown and not start again
  2. Users currently accessing your server will recognize that Apache will not answer request for a short time

Indeed there is a much more better method to restart the Apache “gracefully”:

apache2ctl -t
Syntax OK
apache2ctl -k graceful

The first command will tell Apache to check your config. If everything is correct, you will get “Syntax OK”, otherwise the error will be reported but Apache will still run with the old configuration.

The second command will tell Apache to restart gracefully with the advantage that currently open connections are not aborted and the users will not be annoyed.


Tags:, ,

Liked this article? To continue getting our latest free Howtos and Tutorials,
you can also grab the RSS feed or Subscribe to Techgurulive by Email

Not Getting



Leave a Reply



This Howtos posted under" Apache

Howto Restart Apache Graceful


Find Free Howtos and tutorials on apache, Linux, windows, php, Networking, MySQL, Cisco, open source, Nas, Virtualization, voip, vpn, email,send mail, lamp, security, SEO, squid, Anti virus, Backup, Database and many more