2016-05-22 13 views
0

私はサーバ(servername.dyndns.org)に2つの仮想ホストを設定しました。 どうすればLANの外部からアクセスできますか?複数の仮想ホストapache:LANの外部からのアクセス?

これは私の設定です:

第一仮想ホスト

<VirtualHost *:80> 
    ServerName website1.local 
    DocumentRoot /var/www/website1 
    DirectoryIndex index.html index.php 
    <Directory "/var/www/website1"> 
     AllowOverride All 
     Allow from All 
    </Directory> 
</VirtualHost> 

第二の仮想ホスト

<VirtualHost *:80> 
    ServerName website2.local 
    DocumentRoot /var/www/website2 
    DirectoryIndex index.html index.php 
    <Directory "/var/www/website2"> 
     AllowOverride All 
     Allow from All 
    </Directory> 
</VirtualHost> 

ファイルホスト

127.0.0.1 localhost 
127.0.0.1 website1.local 
127.0.0.1 website2.local 

LAN内では、単一の仮想ホストのdigiting web1.localまたはwebsite2.localにアクセスできます。外側に、servername.dyndns.orgという数字をつけた場合、私はapacheのデフォルトのwelcomeインデックスまたはhostsファイルの最後のインデックスに達します!

ありがとうございました。

+0

何のURL? –

+0

servername.dyndns.orgが、私はApacheのデフォルトのインデックスページにしか届かない! –

答えて

0

あなたはそれらの仮想ホストに到達するためにクライアントコンピュータ上で/etc/hostsまたは/Windows/system32/drivers/etc/hostsを設定する必要があります:あなたがLANの外からそれらのサーバーに到達するために使用している
<server-ip> website1.local
<server-ip> website2.local

関連する問題