无法使用wamp和Chrome访问本地主机 [英] Can't access localhost with wamp and Chrome

查看:450
本文介绍了无法使用wamp和Chrome访问本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从今天开始,当我在启动WAMP之后去到localhost( http:// localhost )时,像往常一样在Firefox中,所有的东西是正常的,但Chrome说:禁止访问,您无权访问此服务器。

$ b

解决方案

编辑:为我解决它。


$ b 这是一个IPv6问题。 Google必须刚刚更新Chrome。



首先确保您的主机文件具有以下行,并取消注释。

  :: 1 localhost 

接下来,打开(httpd.conf),并将以下内容添加到listen部分:

  Listen [:: 1]:80 

接下来,您需要编辑httpd.conf或vhosts文件中的Directory语句。他们可能看起来像这样。

 <目录C:\路径> 
选项索引FollowSymLinks
订单拒绝,允许
拒绝所有
允许来自127.0.0.1
AllowOverride全部
< / Directory>

在'Allow from 127.0.0.1'之后添加一行,看起来像这样

 <目录C:\路径> 
期权指数FollowSymLinks
指令拒绝,允许
拒绝所有
允许从127.0.0.1
允许:: 1
AllowOverride全部
< /目录>


from today, when I go to localhost (http://localhost) after launch WAMP, in Firefox, as usual, everything is normal, but Chrome says "Forbidden, You don't have permission to access / on this server."

Anyone can help me please ?

解决方案

Edit: Solved it for me.

This is an IPv6 problem. Google must have just updated Chrome.

First of all ensure that your hosts file has the following line and that it is uncommented.

::1 localhost

Next, open up your Apache config (httpd.conf) and add the following to the listen section:

Listen [::1]:80

Next, you need to edit you Directory statements in httpd.conf or your vhosts files. They probably look something like this.

<Directory "C:\path">
    Options Indexes FollowSymLinks
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    AllowOverride All
</Directory>

Add an extra line after the 'Allow from 127.0.0.1' so it looks like this

<Directory "C:\path">
    Options Indexes FollowSymLinks
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    Allow from ::1
    AllowOverride All
</Directory>

这篇关于无法使用wamp和Chrome访问本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆