【发布时间】:2021-06-01 08:32:56
【问题描述】:
我正在尝试在我的覆盆子中使用 Apache2 和 Mod-WSGI 运行 Flask 我得到了在此服务器上找不到的请求 URL 我尝试编辑 000-default.conf 但应用程序不会使用 Mod-WSGI。 我用过python 3
谁能告诉我是什么问题?
谢谢 这是我来自 apache2 的状态:
这是 app.wsgi:
#!/usr/bin/python3
import sys
sys.path.insert(0, '/var/www/html/prox')
from init import app as application
这是 000-default.conf
Listen 5000
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/prox
LogLevel debug
WSGIScriptAlias / /var/www/html/prox/app.wsgi
WSGIDaemonProcess prox processes=5 threads=1 user=pi group=pi display-name=%{GROUP}
WSGIProcessGroup prox
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIChunkedRequest On
ErrorLog ${APACHE_LOG_DIR}/error-5000.log
CustomLog ${APACHE_LOG_DIR}/access-5000.log combined
<Directory /var/www/html/prox>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
这个应用程序:命名为 app.py
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home_page():
return render_template('index.html')
app.debug = True
if __name__ == '__main__'
app.run()
我收到了这个错误
【问题讨论】:
标签: python-3.x apache flask raspberry-pi3 mod-wsgi