Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

Alan

share|improve this question

1 Answer 1

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/fcgi.py
www-data  1038  1037  0 09:41 ?        00:00:00 /usr/bin/python /var/www/wsgi/fcgi.py
www-data  1039  1037  0 09:41 ?        00:00:00 /usr/bin/python /var/www/wsgi/fcgi.py

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/fcgi.py
www-data  1143  1142  0 09:43 ?        00:00:00 /usr/bin/python /var/www/wsgi/fcgi.py
www-data  1144  1142  0 09:43 ?        00:00:00 /usr/bin/python /var/www/wsgi/fcgi.py

If you are using the external server, you have to restart the fastcgi server instead. This is official documentation for application reloading in fastcgi: http://www.fastcgi.com/docs/faq.html#application_reload

share|improve this answer

Your Answer

 
discard

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.