I’ve been doing some python webdev using this new web.py toolkit. It’s not bad, but I my host uses apache and apache + fastcgi (for now) means suck. So instead, we used SCGI:
- Install mod_scgi into apache
- Startup your web.py app with the command line arg ‘scgi’. If you want to run on a port other than 4000, or host other than localhost, add [host] port to the commandline. Samples: main.py scgi, main.py scgi 3999, main.py scgi 0.0.0.0 3999
- Add to your apache config for that vhost: SCGIMount / 127.0.0.1:4000
Perhaps in a future post you can explain why SCGI is better than FastCGI? Maybe I’m dense, but from reading the intro to SCGI, it sure doesn’t seem very revolutionary to me. I didn’t know sending headers and content back and forth was the interesting or especially unsolved part of the webserver framework puzzle!
My understanding is that the scgi code is just much clearner than the old fcgi code (which hasn’t recieved an update in quite a while).
I haven’t yet tested any performance difference. I know lighttpd’s fcgi implementation is pretty good.
apache fcgi is notoriously bad. fcgid is supposedly an improvement, but I haven’t had much luck with it. The Apache team is working on a replacement for both of these, from what I have been told.
Great tip thanks.