我无法获得第二个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