I have a few python scripts that I'd like to execute and the following configuration: Ubuntu 10.04, Apache2, Python 2.6, mod_python and mod_wsgi installed.
I've followed the instructions on the following sites:
http://bytes.com/topic/python/answers/474462-apache-python-ubuntu
http://apache.active-venture.com/cgi-configure.html
http://modpython.org/live/current/doc-html/inst-testing.html
http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide
http://wiki.apache.org/httpd/DistrosDefaultLayout
The default file in sites-available :
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AddHandler mod_python .py
AddHandler cgi-script .cgi py
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
I'm getting the 500 internal server error. I've also changed the permissions of the files to 755
The py files simply prints some text that should appear on the page. What should I do? Thanks
[edit]: Update, it's related to bugs in the py file error log shown below.
Traceback (most recent call last):
File "/usr/lib/cgi-bin/amissa2.py", line 80, in <module>
zoom_factor = int(parms.getfirst('zoom')) * int(parms.getfirst('zsize'))
TypeError: int() argument must be a string or a number, not 'NoneType'
It appears to be an error in converting from None to int, over here:
zoom_factor = int(parms.getfirst('zoom')) * int(parms.getfirst('zsize'))
Any hint on how this can such a conversion be done?