Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At one hosting company, they used to run python projects with fcgi. They had set it up so that when i changed django.fcgi file, which put django & my project on pythonpath, my project code was instantly recompiled.

Because of that a friend set up hosting for our shared project in his server using fastcgi. It has been set up and the python scripts execute as they should, but what we do not know is, how to set it up so that my project would be recompiled when my setup file has been changed.


share|improve this question

Are you using mod_fastcgi or mod_fcgid? Anyway, you should just kill the fastcgi process (or have the process commit "suicide"), and apache will respawn another one, loading the new file. I use mod_fastcgi, and this is what I see:

0> ps -ef | grep fcgi
www-data   687   683  0 09:39 ?        00:00:00 /usr/sbin/fcgi-pm -k start
www-data  1037   687  0 09:41 ?        00:00:00 /usr/bin/python /var/www/wsgi/
www-data  1038  1037  0 09:41 ?        00:00:00 /usr/bin/python /var/www/wsgi/
www-data  1039  1037  0 09:41 ?        00:00:00 /usr/bin/python /var/www/wsgi/

0> sudo kill 1037

0> ps -ef | grep fcgi
www-data   687   683  0 09:39 ?        00:00:00 /usr/sbin/fcgi-pm -k start
www-data  1142   687  2 09:43 ?        00:00:00 /usr/bin/python /var/www/wsgi/
www-data  1143  1142  0 09:43 ?        00:00:00 /usr/bin/python /var/www/wsgi/
www-data  1144  1142  0 09:43 ?        00:00:00 /usr/bin/python /var/www/wsgi/

If you are using the external server, you have to restart the fastcgi server instead. This is official documentation for application reloading in fastcgi:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.