XAMPP 3.2.1 的多个虚拟主机
Multiple vhosts with XAMPP 3.2.1
我无法识别第二个 VirtalHost。几年前我让它工作,但在升级路径的某个地方它坏了。
localhost
已识别。 dev
不是。我在 Windows 7 上使用 XAMPP v3.2.1。在浏览器中输入 dev
会将我转到浏览器的搜索引擎。 httpd-vhosts.conf 和主机文件设置如下,我已经包含了来自 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\extra\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\drivers\etc
# 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
开始使用了。
配置正确
.htaccess 文件中的 include_path 不正确。
Firefox 将我重定向到我的搜索引擎,但给了我一个提示栏,内容如下: "Do you want to go to dev instead" 当我点击它时,它给了我一个错误,我可以追踪到路径是问题。
IE 刚刚重定向到我的搜索引擎。
浏览器变得过于smart
试图通过将我发送到搜索来解析我的条目。
我无法识别第二个 VirtalHost。几年前我让它工作,但在升级路径的某个地方它坏了。
localhost
已识别。 dev
不是。我在 Windows 7 上使用 XAMPP v3.2.1。在浏览器中输入 dev
会将我转到浏览器的搜索引擎。 httpd-vhosts.conf 和主机文件设置如下,我已经包含了来自 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\extra\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\drivers\etc
# 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
开始使用了。
配置正确
.htaccess 文件中的 include_path 不正确。
Firefox 将我重定向到我的搜索引擎,但给了我一个提示栏,内容如下: "Do you want to go to dev instead" 当我点击它时,它给了我一个错误,我可以追踪到路径是问题。
IE 刚刚重定向到我的搜索引擎。
浏览器变得过于smart
试图通过将我发送到搜索来解析我的条目。