日期:2014-05-16  浏览次数:20674 次

apache 虚拟主机配置问题
我想在本机上配置两个虚拟主机如下

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
ServerName  www.hanxinxin.com
DocumentRoot  D:/hanxinxin/
DirectoryIndex index.php
<Directory "D:\hanxinxin">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost 127.0.0.1>
ServerName  www.boke.com
DocumentRoot  D:/hanxinxin/wordpress/
DirectoryIndex index.php
<Directory "D:\hanxinxin\wordpress">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>



hosts文件添加如下


127.0.0.1       localhost
127.0.0.1       www.hanxinxin.com
127.0.0.1       www.boke.com


当我在浏览器里输入www.hanxinxin.com时浏览器能访问D:\hanxinxin目录下的index.php
可是我输入www.boke.com时却到了xampp安装目录D:\xampp\htdocs下的index.php这是为什么哇

------解决方案--------------------
重启apache没有?