彻底搞定"403 Forbidden You don’t have permission to access / on this server"

刚装完Wamp,访问localhost,出现如上错误,解决方法如下:

找到httpd.conf文件,看不懂英文不重要,找重点看就行。

首先要申明的是,httpd.conf文件,行首带#的,就是被注释掉了的,这一行就 没有任何用途。

有两处需要修改的地方。

(1)

<Directory />

Options FollowSymLinks

AllowOverride None

Order deny,allow

Deny from all

</Directory>

改为

<Directory />

Options FollowSymLinks

AllowOverride None

Order deny,allow

Allow from all

</Directory>

(2)

<Directory “E:/xaake/wamp/www/”>

#

# Possible values for the Options directive are “None”, “All”,

# or any combination of:

#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

#

# Note that “MultiViews” must be named *explicitly* — “Options All”

# doesn’t give it to you.

#

# The Options directive is both complicated and important.  Please see

# http://httpd.apache.org/docs/2.2/mod/core.html#options

# for more information.

#

Options Indexes FollowSymLinks

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be “All”, “None”, or any combination of the keywords:

#   Options FileInfo AuthConfig Limit

#

AllowOverride all

#

# Controls who can get stuff from this server.

#

#   onlineoffline tag – don’t remove

Order Deny,Allow

Deny from all

Allow from 127.0.0.1

</Directory>

行首是#的,就是被注释掉的,只看行首没有#的就行了

修改最后两行代码

修改结果如下

<Directory “E:/xaake/wamp/www/”>

#

# Possible values for the Options directive are “None”, “All”,

# or any combination of:

#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

#

# Note that “MultiViews” must be named *explicitly* — “Options All”

# doesn’t give it to you.

#

# The Options directive is both complicated and important.  Please see

# http://httpd.apache.org/docs/2.2/mod/core.html#options

# for more information.

#

Options Indexes FollowSymLinks

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be “All”, “None”, or any combination of the keywords:

#   Options FileInfo AuthConfig Limit

#

AllowOverride all

#

# Controls who can get stuff from this server.

#

#   onlineoffline tag – don’t remove

Order Deny,Allow

Allow from all

#Allow from 127.0.0.1

</Directory>

成功解决问题。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值