2017-02-09 3 views
0

今日私は新しいWebプロジェクト用にVHOSTを設定しようとしましたが、解決できなかった問題が発生しました... StackOverflowの助けを借りても... ...XAMPP WIndows VHOSTが常にローカルホストに向いています

私は "httpd-vhosts.conf"を今までに読んだ多くのチュートリアルで説明したように構成し、チュートリアルで述べたようにホストファイルも設定しました...

私もチェックしましたvhostファイルはApacheのhttpd.confに含まれています(それです)

ここに私の設定があります:

VHOST:

NameVirtualHost *:80 
<VirtualHost *:80> 
    DocumentRoot "C:/xampp/htdocs" 
    ServerName localhost 
</VirtualHost> 

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot "C:\xampp\htdocs\Projekte\GamePlay_dev" 
    ServerName gameplay.localhost 
    ServerAlias www.gameplay.localhost 
</VirtualHost> 

HOSTS:

127.0.0.1  localhost 
127.0.0.1  gameplay.localhost 

そして、はい、私はすでに私のサーバーを再起動し...私も念のため、全体のPCを再起動...

+0

私のホストファイルは '#localhostの名前解決はDNS自体の中で処理されます。 #\t 127.0.0.1 localhost #\t :: 1 localhost \t 192.168.1。? www.mywebsite 'すなわち実際のIPアドレスが使用され、私はwwwを保持します。あなたは私では – MikeT

+0

私はServerAliasをまったく使用していません。また、サーバ名はwwwです。私も.localhostを使用していません(違いがあれば分かりません)。私の幻想を答えとして落とします。 – MikeT

+0

(あなたのバーチャルホストのファイルがどこにあるか明らかに指して)あなたのhosts.confでのコメントを外し** 'confに/エクストラ/ httpdの-vhosts.conf'を含める**持っています –

答えて

0

あたりとして私のコメントは、ここに私が持っている働く仮想ホストです: -

# 
# Virtual Hosts 
# 

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot c:/wamp/www 
    <Directory "c:/wamp/www/"> 
     Options +Indexes +FollowSymLinks +MultiViews 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/mt" 
    ServerName www.mt.flnet.org 
    <Directory "C:/wamp/mt"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/trishandmike" 
    ServerName www.tandm.flnet.org 
    <Directory "C:/wamp/trishandmike"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/Judggle" 
    ServerName www.JudggleCopy.flnet.org 
    <Directory "C:/wamp/Judggle"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/mjt" 
    ServerName www.mjt.flnet.org 
    <Directory "C:/wamp/mjt"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/ShopWise" 
    ServerName www.ShopWise.flnet.org 
    <Directory "C:/wamp/ShopWise"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 

私のホストファイルがあります(ノートいくつかは、私は2つのアパッチ異なるマシンを実行していたとして、冗長化され、適切にを片付けていない): -

# localhost name resolution is handled within DNS itself. 
# 127.0.0.1  localhost 
# ::1    localhost 
    192.168.1.2 www.trishandmike.flnet.org 
    192.168.1.2 www.AIPCStudentconnect.flnet.org 
    192.168.1.2 www.zonemike.flnet.org 
    192.168.1.2 www.tristen.flnet.org 
    192.168.1.2 www.csacalc.flnet.org 
    192.168.1.2 www.ocportal.flnet.org 
    192.168.1.2 www.flwgtest.flnet.org 
    192.168.1.2 www.judggle.flnet.org 
    192.168.1.2 www.mt.flnet.org # on 2nd box running later Apacahe etc 
    192.168.1.2 www.tandm.flnet.org # on 2nd box running later Apacahe etc 
    192.168.1.2 www.JudggleCopy.flnet.org 
    192.168.1.2 www.mjt.flnet.org 
    192.168.1.2 www.judgements.flnet.org 
    192.168.1.2 www.shopwise.flnet.org 

Apacheを実行しているPCの静的IPアドレスを持っていますか?

もう1つの違いは、私はWAMPを使用していることです。私は提供されたエイリアスが私にWAMPの後のバージョンでいくつかの面倒を引き起こしたことを知っています。あなたがエイリアスファイルを指しているかどうか確認してください。ホストファイルにInclude "c:/wamp/alias/*"のようなものがあります。私はここから違反ファイルを削除したと思う。

関連する問題