【问题标题】:Why does WAMP says this:"Forbidden You don't have permission to access / on this server."?为什么 WAMP 会这样说:“Forbidden You don't have permission to access / on this server.”?
【发布时间】:2014-06-04 19:19:51
【问题描述】:

所以我在 Windows 7 上安装了 WAMP 并端口转发了我的私有 IP,我尝试使用我的公共 IP,但没有运气。它只是给了我这个错误:禁止

您无权访问此服务器上的 /。我使用 localhost 和 127.0.0.1 对其进行了测试,并且可以正常工作,但是使用我的公共 IP 则无法访问。请帮助我!

【问题讨论】:

标签: html windows wamp


【解决方案1】:

这是因为您的 httpd.conf 文件中的设置。要更正问题,请按照以下步骤操作-

  1. 点击 wamp 图标。
  2. 转到 Apache -> httpd.conf
  3. 现在搜索“控制谁可以从此服务器获取内容”。
  4. 见下文,应该有一行“拒绝所有人”。
  5. 将其更改为“全部允许”。

【讨论】:

  • .htaccess 如果有也可能出错
  • 也许,但我也有同样的错误,并以这种方式正确。如果您使用 url: localhost 或 127.0.0.1 访问您的网站,那么它应该可以正确打开您的网站。
【解决方案2】:

要允许从 Internet 访问您的 Apache 服务器,您需要告诉 Apache 它允许接受来自任何 IP 地址的连接

使用 wampmanager 菜单链接编辑 httpd.conf

在配置文件中找到这个sn-p

#   onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost

当您使用 Apache 2.4.x 时,将其更改为

#   onlineoffline tag - don't remove
Require all granted

【讨论】:

    猜你喜欢
    • 2017-12-25
    • 2011-06-15
    • 2014-03-29
    • 2016-04-15
    • 1970-01-01
    • 2014-05-19
    • 1970-01-01
    • 2019-02-20
    • 2013-11-01
    相关资源
    最近更新 更多