1

いくつかの詳細

  • XAMPP 1.7.1
  • Vista および XP でテスト済みの OS

こんにちは、みんな。仮想ホストの構成に問題があります。現在、私は2つのサイトを持っています。

ここに私の vhost.conf ファイルがあります:

<VirtualHost *:80>
    ServerAdmin me@site.nl
    DocumentRoot c:/xampp/htdocs/site1/trunk/
    ServerName site1.local
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin me@site.nl
    DocumentRoot c:/xampp/htdocs/site2/trunk/
    ServerName site2.local
</VirtualHost>

そしてもちろん、私のホストファイルには

127.0.0.1 site1.local
127.0.0.1 site2.local

Apacheとブラウザを何度も再起動しました。

これが私の問題です:

http://site1.local作品。しかし、http://site2.localにアクセスすると、site1.local に着陸します。

何か案は?

4

1 に答える 1

2

試す

<VirtualHost "site1.local">
    ServerAdmin spam@a1230912##ad#.nl
    DocumentRoot c:/xampp/htdocs/site1/trunk/
    ServerName site1.local
</VirtualHost>

<VirtualHost "site2.local">
    ServerAdmin spam@a1230912##ad#.nl
    DocumentRoot c:/xampp/htdocs/site2/trunk/
    ServerName site2.local
</VirtualHost>

Apache はデフォルトで最初に設定されるため、常に site1 を取得します。

編集

コメント解除

#NameVirtualHost *

NameVirtualHost *

httpd.conf で

私の言う(/etc/httpd/conf/httpd.conf)

126 # Listen: Allows you to bind Apache to specific IP addresses and/or
127 # ports, in addition to the default. See also the <VirtualHost>
128 # directive.
129 #
130 # Change this to Listen on specific IP addresses as shown below to 
131 # prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
132 #
133 Listen 127.0.0.1:80
134 NameVirtualHost 127.0.0.1

そして、私のvhostファイルには

<VirtualHost "www.whatever.com">
        DocumentRoot /var/www/html/whatever/pub
        ErrorLog logs/error_log
        ServerName www.whatever.com
...
于 2009-05-25T14:54:55.313 に答える