I have some python scripts that I would like to execute, and the following configuration: Ubuntu 10.04, Apache2, Python 2.6, mod_python and mod_wsgi.
I 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 on accessible sites:
<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 get an internal server 500 error. I also changed the file permissions to 755
The py files simply print the text to be displayed on the page. What should I do? Thanks
[edit]: , py
, .
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'
, None int:
zoom_factor = int(parms.getfirst('zoom')) * int(parms.getfirst('zsize'))
- , ?