部署燒瓶WSGI應用問題我創建了一個文件瓶的應用程序,所以我可以測試如何部署它的Apache2服務器上。就服務器和WSGI配置而言,我遵循Flask上的步驟。當我指向瀏覽器中的資源時,它說我沒有權限。 WSGI守護程序與Flask應用程序具有相同的權限。以下是VirtualHost配置。上的Apache2
<VirtualHost *:80>
ServerName localhost
WSGIDaemonProcess flask_test user=someuser group=someuser threads=5
WSGIScriptAlias /flask_test/ /var/www/flask_test/flask_test.wsgi
DocumentRoot /var/www/flask_test/
ErrorLog /var/www/flask_test/logs/error.log
<Directory /var/www/flask_test/>
WSGIProcessGroup flask_test
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Order deny,allow
Deny from all
</Directory>
</VirtualHost>
這裏的WSGI文件
import sys
activate_this = '/home/someuser/pyProjects/general/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.append('/home/someuser/pyProjects')
from general import test as application
而且從最後是error.log輸出
[Tue Jul 31 01:51:18 2012] [error] Exception KeyError: KeyError(140345719740224,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Tue Jul 31 01:51:21 2012] [error] [client 108.207.222.48] client denied by server configuration: /var/www/flask_test/flask_test.wsgi
[Tue Jul 31 01:51:21 2012] [error] [client 108.207.222.48] client denied by server configuration: /var/www/flask_test/favicon.ico
編輯:實施格雷厄姆鄧普爾頓建議服務器後,現在返回碼500以下錯誤 TypeError: 'module' object is not callable
謝謝。我應用了你的建議,似乎我越來越接近了。現在我得到500錯誤,並在error.log錯誤日誌中出現'TypeError:'模塊'對象不可調用'。有沒有辦法獲得更詳細的輸出? – 2012-07-31 03:02:34