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?
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