2017-04-19 123 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映射。