我们正在使用基于mod-wsgi的托管。 我已按照以下网址中的步骤进行操作:
http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi/
编辑1:最新网址: http://flask.pocoo.org/docs/1.0/deploying/mod_wsgi/
Apache错误日志显示以下消息:
Loading WSGI script '/var/www/html/trunk/SPM/wsgi/flask.wsgi'
wsgi文件如下所示:
import os
import sys
sys.stdout = sys.stderr
sys.path.insert(0,"/var/www/html/trunk/SPM")
from SPM.run import order as application
文件夹树结构如下所示:
|-- __init__.py
|-- order_manager
| |-- __init__.py
| |-- order_manager.wsgi
| |-- views.py
|-- run.py
|-- wsgi
| `-- flask.wsgi
有人可以帮我解决这个问题吗?
答案 0 :(得分:0)
这可能对某人有所帮助。
我通过更新/etc/apache2/conf-enabled/ormgr.conf
文件
<VirtualHost *:5000>
ServerName 10.51.0.103
WSGIDaemonProcess ormgr python-path=/var/www/html/trunk/SPM user=www-data group=www-data threads=5
WSGIScriptAlias / /var/www/html/trunk/project/wsgi/flask.wsgi
<Directory /var/www/html/trunk/SPM/wsgi>
WSGIProcessGroup ormgr
WSGIApplicationGroup %{GLOBAL}
#Require all granted
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>