Running web.py behind SCGI

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:

  1. Install mod_scgi into apache
  2. 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
  3. Add to your apache config for that vhost: SCGIMount / 127.0.0.1:4000

3 Comments

  1. Posted February 16, 2006 at 12:02 am | Permalink

    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!

  2. Posted April 5, 2006 at 1:56 pm | Permalink

    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.

  3. Posted December 14, 2006 at 10:54 pm | Permalink

    Great tip thanks.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*