Hi, I think one commonly known way of adding PHP to an Apache webserver is to configure it like this:
ScriptAlias /php5.3 /usr/local/php5.3/bin
Action application/php5.3 /php5.3/php-cgi
AddType application/php5.3 .php
Now I tried to write a similar configuration for Python:
ScriptAlias /python /usr/bin
Action application/python /python/python
AddType application/python .py
I have a small test script that looks like this:
print "Content-Type: text/html\n\n"
print "Test"
But something seems to be wrong since the apache error log says the following:
Premature end of script headers: python
So my first though was that my python response is not right. But there is the Content-Type and also both linebreaks. Also the output of a similar PHP script called with php-cgi
gives exactly the same output.
Also I haven't found a tutorial that shows how to get python working this way. So maybe it is not possible, but then I'm curious why this is the case? Or am I missing something?