【发布时间】:2012-02-17 11:37:30
【问题描述】:
我用mod_wsgi搭建了apache下的python web微框架flask。
除了 python confparser 之外,该应用程序运行良好。这不会引发错误:
parser = ConfigParser.ConfigParser()
parser.read('snati.con')
但是当我添加:
parser.get('database', 'user')
我得到 internal server error Apache 的 error.log 中没有任何内容
我也试过了:
file = open("sample.txt")
同样的结果。
肯定有一些配置问题,但我找不到。
我的 apache conf 看起来像:
WSGIRestrictStdout Off
<VirtualHost *:80>
ServerName my.com
WSGIDaemonProcess myapp user=me group=me threads=5
WSGIScriptAlias / /home/me/www/myapp.wsgi
<Directory /home/me/www/myapp >
WSGIProcessGroup myapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
我的 app.wsgi
#active the python virtualenv for this application
activate_this = '/home/gilles/www/snati/env/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
import sys
sys.path.insert(0, '/home/gilles/www/snati/src')
sys.stdout = sys.stderr
from app import app as application
什么可能是错误的,为什么我在 Apache 日志中看不到错误?
【问题讨论】: