Python for CGI scripting

Duncan Booth duncan at NOSPAMrcp.co.uk
Mon Aug 5 17:01:45 CEST 2002


"Steve Holden" <sholden at holdenweb.com> wrote in 
news:s2w39.253023$724.26384 at atlpnn01.usenetserver.com:

> You should at least consider the following options:
> 
>     1. mod_python
> 
>     2. mod_snake
> 
>     3. FastCGI
> 
> Each of these in some way allows you to take advantage of a Python
> interpreter that was already loaded, and each requires a different
> accomodation to its conditions in the CGI scripting technique you use.

Another option that works quite nicely is to run your scripts inside a 
Python web server and use Apache's reverse proxying to merge the Python 
stuff back into the rest of your website. This is possibly the commonest 
configuration for running Zope (which is excellent evidence that Python 
websites really can scale). Even though it sounds like Zope may be overkill 
for what you want, you could consider extracting the ZServer component and 
using it separately.

Doing it this way lets you keep the Python process completely separate from 
the Apache server (even to run it on a separate machine if you wish) and 
gives you freedom to run multiple python processes with simple load 
balancing if that should become necessary.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list