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
This entry was posted in tech. Bookmark the permalink.

3 Responses to Running web.py behind SCGI

  1. Andrew Ho says:

    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. eliott says:

    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.

Leave a Reply to Andrew Ho Cancel reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>