user784637
user784637

Reputation: 16142

Ways to take a site offline for maintenance without killing running php started from http side?

I wrote a script upload_songs.php

When executed from the command line

$ php upload_songs.php

I can take the site offline

$ a2dissite my_website
$ service apache2 reload

and upload_songs.php will continue to run

However when I execute upload_songs.php from the http side by going to my_website.com/upload_songs.php if I do the following

$ a2dissite my_website
$ service apache2 reload

The php process upload_songs.php gets killed. How can I take the site offline for maintenance without killing running php processes that have been started from the http side?

Upvotes: 3

Views: 238

Answers (1)

Adrian Cornish
Adrian Cornish

Reputation: 23866

apachectl graceful

This will wait until all connections are closed before restarting apache.

Docs for apachectl http://httpd.apache.org/docs/2.2/programs/apachectl.html

Upvotes: 5

Related Questions