WAMP环境下配置虚拟主机

1.编辑httpd.conf,查找#Include conf/extra/httpd-vhosts.conf,把前面注释符号“#”删掉

2.编辑httpd-vhosts.conf文件,

<VirtualHost *:80>
ServerName www.xxx.com     //服务器名/虚拟机名
ServerAlias dt.com         //别名
DocumentRoot E:/dt/public    //文件根目录
DirectoryIndex index.php index.html index.htm
<Directory E:/dt/public>    //文件目录
Options +Includes -Indexes
AllowOverride All
Order Deny,Allow
Require all granted
</Directory>
</VirtualHost>

3. 修改C:/WINDOWS/system32/drivers/etc/host这个文件,用记事本或编辑器打开

  加上127.0.0.1 www.xxx.com

4.重启apache

虚拟主机就配置成功了

posted @ 2016-01-23 21:55  侠岚之弋痕夕  阅读(132)  评论(0编辑  收藏  举报
Where is the starting point, we don't have a choice, but the destination where we can pursue!