I have nginx running on a VM and I want to run a Trac site. I need to run a python FastCGI server, but I cannot tell which is the server to use. I have found the following:
- Lighttpd spawn-fcgi But this seems to require that you compile lighttpd just to get the fcgi server, which is weird.
- fcgi.py But this one seems to be deprecated. At the very least it is poorly documented.
- flup This one comes with dependencies on ubuntu (python-cheetah{a} python-mysqldb{a} python-webpy{a}) that seem unnecessary. Also poorly documented.
Are there any recent guides for setting this up? Trac's own FastCGI setup page seems to miss some steps.
trac
should be now WSGI compliant, so you can use any supported method to run the site. If it is a low traffic site, you can always use CGI, and eventually move to something else later if you need it. For the other methods, usemod_wsgi
or installflup
for FCGI (even if it installed extra dependencies).To use
flup
, you have to import the appropriate WSGI server, then run it, i.e.If you want to run it as external server (i.e. not started by the web server), substitute this:
Well man, flup is used by Django itself. Its an awesome method to run python fastcgi applications unless you have a mod_wsgi or something similar.
The code to run flup is:
Why FastCGI in particular? In Python, there's a standard interface for writing web server apps, called WSGI. Various servers provide frameworks for doing this; eg,
mod_wsgi
for Apache. For nginx, there appears to be: http://wiki.nginx.org/NginxNgxWSGIModule which is even based on mod_wsgi.