実行したいPythonスクリプトがいくつかあり、次の構成があります:Ubuntu 10.04、Apache2、Python 2.6、mod_python、mod_wsgiがインストールされています。
次のサイトの指示に従いました。
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
サイトのデフォルトファイル-利用可能:
<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>
500内部サーバーエラーが発生します。また、ファイルのアクセス許可を755に変更しました
pyファイルは、ページに表示されるはずのテキストを出力するだけです。私は何をすべきか?ありがとう
[編集]:更新、以下に示す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'))
このような変換をどのように行うことができるかについてのヒントはありますか?