wsaer 发表于 2015-8-22 14:51:31

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
  虚拟主机就配置成功了
页: [1]
查看完整版本: WAMP环境下配置虚拟主机