WAMP 无法访问本地网络 403 Forbidden [英] WAMP Cannot access on local network 403 Forbidden

查看:32
本文介绍了WAMP 无法访问本地网络 403 Forbidden的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被问过很多次了

我遵循了互联网上的大多数答案,但我仍然收到相同的消息

<块引用>

403 禁止

您无权访问此服务器上的/.

奇怪的是,当我使用同一台 PC 访问 localhost:1234 时,它运行正常,但如果我使用我的 IP 地址访问 192.168.0.188:1234

还有一点很奇怪,我试图在其他 PC 上安装 WAMP,但没有任何配置我就可以访问那台 PC.

所以我认为是因为 McAfee 和防火墙,所以我在 Widows 和 McAfee 上打开了端口,但没有任何变化,我也关闭了防火墙,但仍然没有任何变化.

然后我无缘无故地通过路由器端口转发"打开了端口,但仍然没有任何变化.

我不认为这是因为我在 WAMP 中的配置,因为我仍然能够收到这个 403 Forbidden 消息,并且通过使用其他没有任何配置的 PC 我可以访问它.

两台电脑的设置如下:

Windows 8 专业版

  • WAMP Wampserver: 2.4
  • Apache 版本: 2.4.4
  • PHP 版本: 5.4.12
  • MySQL 版本: 5.6.12

可访问的 PC 使用 Microsoft Security Essentials.

无法访问的 PC 使用 McAfee Internet Security.

我尝试关闭关闭 WAMP启动 IIS 对于 Microsoft 服务器(我可以在任何 PC 上完美运行)但 WAMP 仍然无法正常工作

我遵循了这些教程:

  • 它应该是这样的:

    服务器名称本地主机文档根目录 D:/wamp/www<目录D:/wamp/www/">选项 +Indexes +FollowSymLinks +MultiViews允许覆盖所有需要本地</目录></虚拟主机>

    修改为

    服务器名称本地主机文档根目录 D:/wamp/www<目录D:/wamp/www/">选项 +Indexes +FollowSymLinks +MultiViews允许覆盖所有要求所有授予</目录></虚拟主机>

    希望您已经为您的项目创建了一个虚拟主机,而不是为您的站点使用 wamp\www 文件夹.在这种情况下,不要管本地主机定义,只对您的虚拟主机进行更改.

    不要忘记在进行此更改后重新启动 Apache

    I know this question has been asked a lot of times

    I followed Most of the answers in the internet But I still get the same Message

    403 Forbidden

    You don't have permission to access / on this server.

    It is weird that when I access using the same PC to localhost:1234 it runs normally but if I access using my IP address 192.168.0.188:1234

    Also which is really weird is that I tried to install WAMP on other PC and without any configuration I could access to that PC.

    So I thought it's because McAfee and Firewall so I open port on Widows and McAfee and nothing changed also I turned off Firewall and still nothing change.

    Then for no reason I opened port through the Router "port forwarding" and still nothing changed.

    I don't think that it's because my configuration in WAMP since I am still able to get this 403 Forbidden Message and also by using other PC without any configuration I could access it.

    Both PCs are setup like this:

    Windows 8 Pro

    • WAMP Wampserver: 2.4
    • Apache Version: 2.4.4
    • PHP Version: 5.4.12
    • MySQL Version: 5.6.12

    The accessible PC uses Microsoft Security Essentials.

    The inaccessible PC uses McAfee Internet Security.

    I tried to turn off WAMP and start IIS For Microsoft Server (I works perfectly From any PC) but WAMP is still not not working

    I followed these tutorial:

    And the Stack Overflow answers here:

    解决方案

    If you are using WAMPServer 3 See bottom of answer

    For WAMPServer versions <= 2.5

    By default Wampserver comes configured as securely as it can, so Apache is set to only allow access from the machine running wamp. Afterall it is supposed to be a development server and not a live server.

    Also there was a little error released with WAMPServer 2.4 where it used the old Apache 2.2 syntax instead of the new Apache 2.4 syntax for access rights.

    You need to change the security setting on Apache to allow access from anywhere else, so edit your httpd.conf file.

    Change this section from :

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

    To :

    #   onlineoffline tag - don't remove
        Require local
        Require ip 192.168.0
    

    The Require local allows access from these ip's 127.0.0.1 & localhost & ::1.

    The statement Require ip 192.168.0 will allow you to access the Apache server from any ip on your internal network. Also it will allow access using the server mechines actual ip address from the server machine, as you are trying to do.

    WAMPServer 3 has a different method

    In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for localhost so you have to make the access privilage amendements in the Virtual Host definition config file

    First dont amend the httpd.conf file at all, leave it as you found it.

    Using the menus, edit the httpd-vhosts.conf file.

    It should look like this :

    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot D:/wamp/www
        <Directory  "D:/wamp/www/">
            Options +Indexes +FollowSymLinks +MultiViews
            AllowOverride All
            Require local
        </Directory>
    </VirtualHost>
    

    Amend it to

    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot D:/wamp/www
        <Directory  "D:/wamp/www/">
            Options +Indexes +FollowSymLinks +MultiViews
            AllowOverride All
            Require all granted
        </Directory>
    </VirtualHost>
    

    Hopefully you will have created a Virtual Host for your project and not be using the wamp\www folder for your site. In that case leave the localhost definition alone and make the change only to your Virtual Host.

    Dont forget to restart Apache after making this change

    这篇关于WAMP 无法访问本地网络 403 Forbidden的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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