wamp2.5 配置站点

遇到了这样的问题,装好了wamp2.5 ,配置站点时,发现配好的shop111.com可以访问,而localhost不能,加了下面这个就可以了


<VirtualHost *:80>

   ServerAdmin webmaster@dummy-host2.example.com

   DocumentRoot "E:/wamp/www"

   ServerName localhost

   ErrorLog "logs/dummy-host2.example.com-error.log"

   CustomLog "logs/dummy-host2.example.com-access.log" common

</VirtualHost>


在下面也有讲到。


下面是所有的配置:

httpd.conf 文件(在 E:\wamp\bin\apache\apache2.4.9\conf   我装在了E盘)

 打开(即去掉前面的“#”)

Include conf/extra/httpd-vhosts.conf

 打开

LoadModule php5_module"E:/wamp/bin/php/php5.5.12/php5apache2_4.dll"

 打开

PHPIniDir E:/wamp/bin/php/php5.5.12


httpd-vhosts.conf文件  (E:\wamp\bin\apache\apache2.4.9\conf\extra)

加入下面两部分

 

这是为了让localhost正常显示:

<VirtualHost *:80>

   ServerAdmin webmaster@dummy-host2.example.com

   DocumentRoot "E:/wamp/www"

   ServerName localhost

   ErrorLog "logs/dummy-host2.example.com-error.log"

   CustomLog "logs/dummy-host2.example.com-access.log" common

</VirtualHost>


这是为了让shop111.com正常显示:

<VirtualHost *:80>

   ServerAdmin webmaster@dummy-host2.example.com

   DocumentRoot "E:/wamp/www/yii1/shop"

   ServerName shop111.com

   ErrorLog "logs/dummy-host2.example.com-error.log"

   CustomLog "logs/dummy-host2.example.com-access.log" common

</VirtualHost>


ps: 这两行是主要的

   DocumentRoot "E:/wamp/www/yii1/shop"  (这是想访问的那个文件夹目录)

   ServerName shop111.com  (这是网址)

其余的没有改...

hosts文件(位置:C:\Windows\System32\drivers\etc)

加入:

127.0.0.1   shop111.com




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值