httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <>
Subject Apache with embedded Python interpreter (fwd)
Date Sat, 09 Dec 1995 21:17:45 GMT

I told the submitter that if anyone is interested in this then one
of you will contact him.

Forwarded message:
> From  Fri Dec  8 22:46:46 1995
> Date: Sat, 9 Dec 1995 01:46:32 -0500
> From: Skip Montanaro <>
> Message-Id: <>
> To:
> Subject: Apache with embedded Python interpreter
> Reply-to: (Skip Montanaro)
> It's quite easy to embed a Python interpreter ( in
> Apache by modifying the cgi_child() function in mod_cgi.c.  Dave Mitchell at
> did this recently.  This avoids the exec call, but unfortunately
> doesn't avoid the fork call.  It's not clear to me just what all has to be
> done to set things up for the interpreter so I can invoke it before the call
> to spawn_child in cgi_handler.
> Is it sufficient to set up the environment variables and provide someplace
> for the CGI script to read stdin and dump stdout?  It looks like POST/PUT
> input for the script is in a buffer waiting to toss at the script and that
> all script output is just shuffled off to the client connection (modulo any
> Location: headers).
> What I'm trying to do may not be entirely feasible since CGI scripts are
> designed to write to stdout and read from stdin.  However, Python does have
> a StringIO class that can suffice for most uses of stdin and stdout.  I can
> set up instances of StringIO in place of the script's stdin and stdout
> before invoking the interpreter, then read and process their contents after
> the script completes execution.
> Any feedback appreciated.
> Skip Montanaro			  (518)372-5583
> Musi-Cal: or
> Internet Conference Calendar:
> 	       >>> ZLDF: <<<

View raw message