I been googling and searching this forum for about an hour and tried various suggestions and still can't get this working.
I have Ubuntu 8.04 LTS server.
I used apt-get install libapache2-mod-python to install it.
I edited my /etc/apache2.conf CGI directories area (virtual hosting system, btw) as follows:
This is my Python test program:Code:# CGI Script Configuration ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory /var/www/public_html/*/> #AddHandler cgi-script .cgi AddHandler cgi-script .cgi .py #AddHandler cgi-script .py Options +ExecCGI +Includes AddHandler mod_python .py PythonHandler mod_python.publisher PythonDebug On AddType text/html .shtml AddHandler server-parsed .shtml AddOutputFilter INCLUDES .shtml </Directory>
In Firefox 3, I get a pop-up window asking me what application I want to open the .py file with.Code:from mod_python import apache def handler(req): req.content_type = 'text/plain' req.write("Hello World!") return apache.OK
In IE 7, it just dumps the source code to test.py without line breaks.
Can someone please point me in the right direction?
Thanks...



Adv Reply

Bookmarks