Ubuntu 12.10 Server in a virtualbox VM.
I have installed mod_python
using apt-get
,enabled it using a2enmod
, and rebooted apache2
. I have also edited \etc\apache2\sites-available\defaults
as below. My script resides in /var/www/py/
and is called via a jQquery.ajax post function. This script is triggering, but returns itself - in plain text. It should be returning json, indicating that I have missed some obvious setup step.
Uncommenting the testhandler line, below, results in the script returning mod_python.testhandler output - essential the php.info() output, but for python.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks Indexes MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/py>
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
#PythonHandler mod_python.testhandler
PythonDebug On
</Directory>