Apache Web服务器多个项目文件夹托管问题
问题描述:
我已配置/etc/apache2/sites-enabled/000-default.conf
如下。Apache Web服务器多个项目文件夹托管问题
ServerName 0.0.0.0
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
WSGIDaemonProcess python-app threads=15 maximum-requests=10000
WSGIScriptAlias//var/www/html/myapp/myapp.wsgi
WSGIProcessGroup python-app
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/myapp>
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/html/test"
<Directory "/var/www/html/test">
AllowOverride All
</Directory>
</VirtualHost>
现在我的项目文件夹结构是这样的:
我能够访问myapp
(蟒蛇瓶项目)。但不是我的test
项目html
文件。看起来像myapp.wsgi
(通过烧瓶应用程序)管理所有urls
。像test\index.html
这样的url(用于访问测试项目)未在flask应用中配置,因此出现错误。
答
它更新后工作WSGIScriptAlias
/api /var/www/html/myapp/myapp.wsgi
。需要拨打apis
与/api
在前面
最初它是WSGIScriptAlias
/ /var/www/html/myapp/myapp.wsgi
覆盖所有的url映射。