我無法獲得第二個VirtalHost被識別。幾年前,我開始工作,但在升級途徑的某個地方它已經破產。XAMPP的多個虛擬主機3.2.1
localhost
是公認的。 dev
不是。我在Windows 7上使用XAMPP v3.2.1。在瀏覽器中輸入dev
將我發送到瀏覽器的搜索引擎。 httpd-vhosts.conf和hosts文件的設置如下,我已經包含了從C:\ xampp \ apache \ bin \ httpd -S轉儲。任何幫助將不勝感激。
注意:如果我在dev
目錄中鍵入index.php
文件的顯式路徑,它將不會作爲php文件運行,但它只是列出內容。
另外:在我的access.log,我得到如下:
127.0.0.1 - - [04/Jul/2015:09:48:12 -0700] "GET /css/ms.js HTTP/1.1" 304 - "http://localhost/dev" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
我的C:\ XAMPP的\ apache的\的conf \額外\的httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "D:/Website/root"
ServerName localhost
<Directory "D:/Website/root">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
deny from all
Allow from localhost
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/Website/dev"
ServerName dev
<Directory "D:/Website/dev">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
deny from all
Allow from localhost
Require all granted
</Directory>
</VirtualHost>
我的C :\ Windows \ System32下\驅動程序\等
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
127.0.0.1 dev
C:> C:\ XAMPP \ apache的\ BIN \的httpd -S
VirtualHost configuration: *:80 is a NameVirtualHost
default server localhost (C:/xampp/apache/conf/extra/httpd-vhosts.conf:44)
port 80 namevhost localhost (C:/xampp/apache/conf/extra/httpd-vhosts.conf:44)
port 80 namevhost dev (C:/xampp/apache/conf/extra/httpd-vhosts.conf:60)
ServerRoot: "C:/xampp/apache"
Main DocumentRoot: "D:/Website/root"
Main ErrorLog: "C:/xampp/apache/logs/error.log"
Mutex rewrite-map: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="C:/xampp/apache/logs/" mechanism=default
PidFile: "C:/xampp/apache/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG