【发布时间】:2013-10-16 04:44:09
【问题描述】:
我正在尝试配置 mod_wsgi 以使用简单的 web.py python 脚本。我遵循了这本食谱:http://webpy.org/cookbook/mod_wsgi-apache
每次我去https://<server>/appname/ chrome 都会说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
我需要进行哪些修改才能使其正常工作?
【问题讨论】:
标签: python apache mod-wsgi web.py