我想配置mod_wsgi以使用一個簡單的web.py python腳本。我跟着這個食譜:http://webpy.org/cookbook/mod_wsgi-apache如何解決「內部服務器錯誤」使用mod_wsgi與web.py
每次我去https://<server>/appname/
鉻說Internal Server Error
這裏是我的配置細節:在httpd.conf
我
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias /appname /var/www/webpy-app/cody.py/
Alias /appname /var/www/webpy-app/static/
AddType text/html .py
<Directory /var/www/webpy-app/>
Order deny,allow
Allow from all
</Directory>
<Location /appname>
AuthType Basic
AuthName "Authenication Required"
AuthUserFile "/etc/httpd/conf/some_sample_users"
</Location>
下面是代碼:
import web
urls = (
'/.*', 'hello',
)
class hello:
def GET(self):
return "Hello, world."
application = web.application(urls, globals()).wsgifunc()
我檢查了錯誤日誌,但沒有發現太多內容:
[Wed Oct 09 02:24:50 2013] [notice] caught SIGTERM, shutting down
[Wed Oct 09 02:24:55 2013] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Wed Oct 09 02:24:55 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Oct 09 02:24:55 2013] [warn] module wsgi_module is already loaded, skipping
[Wed Oct 09 02:24:55 2013] [notice] Digest: generating secret for digest authentication ...
[Wed Oct 09 02:24:55 2013] [notice] Digest: done
[Wed Oct 09 02:24:55 2013] [notice] Apache/2.2.15 (Unix) mod_wsgi/3.2 Python/2.6.6 DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips configured -- resuming normal operations
需要進行哪些修改才能使其正常工作?
固定在玩那些帶來了更多的相關答案。我使用yum安裝了mod_wsgi,但是它使用了默認的python2.6。現在我需要刪除它並從源代碼安裝mod_wsgi,以便它可以使用python2.7 – Anthony