2017-04-19 7 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(Pythonのフラスコプロジェクト)にアクセスすることができています。しかし私のtestプロジェクトhtmlファイルではありません。 myapp.wsgi(フラスコアプリ経由)のすべてがurlsを管理しているようです。 test\index.html(テストプロジェクトにアクセスするための)のようなURLは、フラスコのアプリケーションで設定されていないため、エラーが発生します。

答えて

0

更新後に動作しますWSGIScriptAlias/api /var/www/html/myapp/myapp.wsgiapis/apiと呼び出す必要があります。

最初はWSGIScriptAlias/ /var/www/html/myapp/myapp.wsgiで、すべてのURLマッピングをオーバーライドしました。

関連する問題