Change apache to do graceful restarts

by admin on Jan.29, 2012, under DirectAdmin

If you want to avoid download interruptions during apache restarts, apache has to be changed to restart gracefully.
To do that, you’ll need to change your httpd boot script.
The path for your script will vary depending on your OS.
For FreeBsd it’s:
/usr/local/etc/rc.d/httpd
For all other OS’s, it’s:
/etc/init.d/httpd
As for the actual change, you’ll edit the httpd boot script for your system, find this code:

restart)
  stop
  waitforexit "httpd" 20
  start
  ;;

and change it to read:

restart)
  kill -USR1 `cat $PIDFILE`
  ;;

Note, this is not tested as much, so you’ll need to keep an eye on things until you’re satisfied that it’s stable.
An apache restart will no longer start apache if it’s stopped. You must "start" it, as the graceful restart only works on already running processes.

Related posts:

  1. How to downgrade from apache 2 back to apache 1.3 If you need to go back to apache 1.3 after...
  2. Apache won’t start and there is nothing in the logs Chance are, if apache isn’t starting and isn’t logging anything,...
  3. Updating Apache to the latest version You can check the current version of apache by running...
  4. Apache won’t start after update on FreeBSD An issue with php/apache is causing apache not to start...

Related posts brought to you by Yet Another Related Posts Plugin.

:, ,
No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Kontak

Budhi Indah A 31
Cimindi Cimahi 40514
West Java
Indonesia

Phone/SMS :
Info/Bantuan : 62-8158-6270622
Billing/konfirmasi : 62-8888-763551

Self Advertise


My site is worth $7548.2.
How much is yours worth?