2017-04-19 54 views
0

我已配置/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> 

现在我的项目文件夹结构是这样的:

enter image description here

我能够访问myapp(蟒蛇瓶项目)。但不是我的test项目html文件。看起来像myapp.wsgi(通过烧瓶应用程序)管理所有urls。像test\index.html这样的url(用于访问测试项目)未在flask应用中配置,因此出现错误。

回答

0

它更新后工作WSGIScriptAlias/api /var/www/html/myapp/myapp.wsgi。需要拨打apis/api在前面

最初它是WSGIScriptAlias/ /var/www/html/myapp/myapp.wsgi覆盖所有的url映射。

相关问题