Configuring Apache to serve python cgi script
andres at corrada.com
andres at corrada.com
Fri Aug 11 13:29:02 EDT 2000
Proverbial enlightment after sending out help message:
I was mispelling "Content-Type" in the script so Apache added an additional
field of "Content-Type: application/x-httpd-cgi" that trigerred the Netscape
response.
I found this out by looking at the HTTP headers in the response. In case you
don't know how to do this there are two ways to do so:
1. using Lynx with the --mime-header switch
2. telnet to the site like so:
telnet www.whatever.com 80
GET /path/to/document HTTP/1.1
Host: www.whatever.com
<Return>
<Return>
This prints out the headers and documents to the command window.
On Fri, Aug 11, 2000 at 01:12:36PM -0400, Andres Corrada-Emmanuel wrote:
> Hi,
>
> I'm using Apache+Zope to serve up a website. In addition, I want to be
> able to serve regular cgi scripts.
>
> This is all being accomplished by the use of the mod_rewrite module in Apache. So I have a rule that goes like this:
>
> RewriteRule ^/cgi-bin/(.*) /path/to/cgi-bin/$1 [t=application/x-httpd-cgi]
>
> The problem is that this triggers Netscape to save the file instead of
> executing the file.
>
> This has me stumped because there is a similar rule that serves the Zope content and it also sets the type to "application/x-httpd-cgi" and it gets executed properly.
>
> Why is this happening? How do I fix it? Thank you.
>
> Andres Corrada
>
> --
> http://www.python.org/mailman/listinfo/python-list
>
--
------------------------------------------------------
Andres Corrada-Emmanuel Email: andres at corrada.com
------------------------------------------------------
More information about the Python-list
mailing list