2016-06-20 11 views
0

を働いていない:のApache2:2つの仮想ホスト(ドメイン&サブドメイン)/ 1 IP - 私はこれのconfファイルのセットアップを持っている

Listen 80 

<VirtualHost 0.0.0.0:80> 
     ServerAdmin [email protected] 
     ServerName test.example.com 
     WSGIScriptAlias//var/django/test/test/wsgi.py 
     #WSGIPythonPath /var/django/test 

     <Directory /var/django/test/test> 
     <Files wsgi.py> 
     Order deny,allow 
     Allow from all 
     </Files> 
     </Directory> 
     DocumentRoot /var/www/html 
     ErrorLog ${APACHE_LOG_DIR}/error.log 
     CustomLog ${APACHE_LOG_DIR}/access.log combined 

</VirtualHost> 
<VirtualHost 0.0.0.0:80> 
     ServerAdmin [email protected] 
     ServerName www.example.com 
     ServerAlias *.example.com 
     DocumentRoot /var/www/html 
     ErrorLog ${APACHE_LOG_DIR}/error.log 
     CustomLog ${APACHE_LOG_DIR}/access.log combined 

</VirtualHost> 

私が開くたびwww.example.com、test.example.comまたはexample.com私はいつも標準のApacheウェブサイトを受け取ります。

2番目のVirtualHostを削除すると、アクセスが拒否されます(wsgi-fileのアクセス許可は正しく設定されているため)。

しかし、2つ(またはそれ以上)の異なるVirtualHostを異なるサブドメインで実行できないのはなぜですか?

ありがとうございます!

ケヴ

PS:私は、私は、エラーを発見したサブドメインtest.example.com

+0

「DocumentRoot」が同じ場合はどうしますか? – tkausl

+0

最初の場合、私はpythonファイルを実行することを期待しています。 – Kev

答えて

0

にDjangoのサイトを実行してみてください。

2番目に「。」がありました。 "80"の代わりに。

関連する問題