我正在使用mod_wsgi 4.5版本部署带有httpd 2.4的Flask应用程序。
我的servername sample.server.com运行正常但是当我尝试使用像sample.server.com/app1这样的子网址时,遇到了404错误。
我也尝试使用localshost / app1它正在工作,这意味着我的烧瓶应用程序总体上很好但是有一些配置问题,我无法弄清楚。
我提供wsgi文件和virtualhost配置,我尝试阅读很多文章和博客,但我找不到解决方案。我将不胜感激任何帮助,谢谢
app.wsgi - >
activate_this = '/home/nmapi/venv/bin/activate_this.py'
with open(activate_this) as file_:
exec(file_.read(), dict(__file__=activate_this))
from werkzeug.wsgi import DispatcherMiddleware
import sys
import logging
print(sys.path)
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"home/nmapi/project/dir")
from run import *
我的vurtual主机配置
#ServerName sample.server.com
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias /test_wsgi
/home/nmapi/project/dir/datascience.wsgi
<Directory /home/nmapi/project/dir/>
#WSGIProcessGroup score
#AllowOverride All
Require all granted
#Allow from all
</Directory>
Alias /static /home/nmapi/project/dir/static
<Directory /home/nmapi/project/dir/static/>
WSGIProcessGroup score
#WSGIApplicationGroup %{GLOBAL}
#AllowOverride All
Require all granted
#Allow from all
</Directory>
ErrorLog logs/error.log
#ErrorLog /tmp/error.log
LogLevel debug
#CustomLog /tmp/access.log combined
CustomLog logs/access.log combined