wamp配置虚拟主机

首先

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

2  找到安装目录下wamp\bin\apache\Apache2.2.17\conf\extra 下 httpd-vhosts.conf这个文件

3 把 里面的内容清空掉 换成下面的内容

<VirtualHost 127.0.0.1:80>
    DocumentRoot E:/htdocs/dz
   ServerName www.dz.com
 DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml


<Directory "E:/htdocs/dz">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.2:80>
    DocumentRoot E:/htdocs/cms
   ServerName www.dd.com

 DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml

<Directory "E:/htdocs/cms">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.3:80>
    DocumentRoot E:/htdocs/dgcms
   ServerName www.dg.com

 DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml


<Directory "E:/htdocs/dgcms">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.4:80>
    DocumentRoot E:/htdocs/phpmyadmin
   ServerName www.myadmin.com

 DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml


<Directory "E:/htdocs/phpmyadmin">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

4 修改C:/WINDOWS/system3/drivers/etc/host这个文件,用记事本打开,加上如下内容:
  127.0.0.1  www.maypp.com
5然后重启apache,在浏览器里面输入www.dd.com,看看访问到的内容  

转载于:https://www.cnblogs.com/kakaxi/archive/2011/06/29/2092940.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值