Apache禁止错误WAMP [英] Apache Forbidden Error WAMP

查看:102
本文介绍了Apache禁止错误WAMP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前使用带有Apache 2.4.23的WAMP 3.06.导航到服务器计算机上的localhost可以正常工作,但是当我尝试转到网络或域上服务器的IP时,会出现Forbidden on/错误.我的httpd.conf文件具有:

Currently using WAMP 3.06 w/ Apache 2.4.23. Navigating to localhost on the server computer works perfectly, but when I try to go to the IP of the server on my network or the domain, I get a Forbidden on / error. My httpd.conf file has:

<Directory />
    AllowOverride none
    Require all denied
</Directory>

谢谢!

推荐答案

httpd.conf文件的这一小部分

<Directory />
    AllowOverride none
    Require all denied
</Directory>

通过拒绝访问该驱动器上的任何内容来保护安装了Apache的驱动器的根文件夹免遭黑客入侵(如果您的Apache服务器遭到黑客入侵).

protects the root folder of the drive that Apache is installed on from hacking (should you Apache server get hacked) by denying access to anything on that drive.

这是正常的安全做法,拒绝访问所有内容,然后专门允许仅访问需要访问的内容.

This is normal security practice, deny acces to everything, then specifically allow access to only what is needed to be accessible.

默认情况下,WAMPServer被配置为单个用户,开发人员工具只能从运行WAMPServer的PC上访问.这是为了保护初学者免于意外被黑客入侵的可能,因为NOBODY可以从运行WAMPServer的IP地址之外的任何IP地址访问WAMPServer中的Apache.

By default WAMPServer is configured as a single user, developer tool accessable only from the PC running WAMPServer. This is to protect beginners from any possibility of accidentally being hacked, as NOBODY can gain access to the Apache in WAMPServer from any IP Address other that the one running WAMPServer.

从WAMPServer 3开始,我们将WAMPServer配置为具有为localhost定义的虚拟主机.这意味着,要更改对Apache的默认访问权限,必须相应地编辑httpd-vhost.conf文件.

As of WAMPServer 3, we configured WAMPServer to have a Virtual Host defined for localhost. This means that in order to alter the default access to Apache, you have to edit the httpd-vhost.conf file accordingly.

通过wampmanager菜单系统可通过以下方式访问该文件:

Access to this file is provided from the wampmanager menu system via

(left click) wampmanager -> Apache -> httpd-vhost.conf

单击此按钮,您的编辑器将打开此文件.

Click this and your editor will open this file.

默认情况下看起来像这样

It will look like this by default

#
# Virtual Hosts
#

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

为了在您的局域网上开放对IP地址的访问,您可以添加特定的IP地址,例如

In order to open up access to ip addresses on your LAN you can either add specific IP addresses like this

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

        # New line
        Require ip 192.168.1.111

    </Directory>
</VirtualHost>

或者您可以仅使用子网的前三个四分位数,将其提供给子网中的任何IP地址

Or you can make it available to any ip address on your subnet by using just the first 3 quartiles of the subnet like this

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

        # New line
        Require ip 192.168.1
    </Directory>
</VirtualHost>

更改此文件后,将其保存,然后再次使用菜单重新启动Apache

Once this file is change, save it, and then restart Apache, again using the menus

wampmanager -> Apache -> Service Administration -> Restart Service

然后重试从局域网上的另一台PC访问apache

Then retry accessing apache from another pc on your LAN

这篇关于Apache禁止错误WAMP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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