BaseHTTPServer and Apache

Ron Garret rNOSPAMon at
Sat Apr 14 01:25:39 CEST 2007

I have a fairly large web app written in Python as a CGI fairly 
elaborate CGI.  All of the requests go through a single CGI script which 
does authentication and session management and then dispatches to one of 
a number of handlers that generate the various pages.

There is one page that is a performance bottleneck (because it is 
accessed automatically once a second by an XMLHTTPRequest, but that's 
another story).  I have fixed this by re-implementing that page using a 
BaseHTTPServer.  So I can fix my problem by redirecting the 
XMLHTTPRequest to a URL that is served by this BaseHTTPServer.

The problem is that this server can't run on port 80 because Apache has 
to be there to serve everything else, and having a Python process 
serving a publicly accessible TCP port makes me a little queasy.  Does 
anyone know of a straightforward way to get Apache to "forward" requests 
to a given path to another HTTP server running on a different port?

Also, is anyone out there using BaseHTTPServer in an industrial setting?  
What has been your experience with it?  And how do you make it fit in to 
your overall architecture?


More information about the Python-list mailing list