2014-02-10 179 views
1

我正在研究一个传感器系统的项目。这些传感器基于Raspberry Pi和Web应用程序来收集和显示基于PHP的信息。WampServer HTTP 403禁止

我已经在我的笔记本电脑以及学校的台式电脑上安装了Wamp Server。我在学校运行Windows 7时运行Windows 8,让我们说学校的网络是“SIT.edu”。

我有一个WebS.php文件我想要Raspberry Pi python脚本来访问。使用学校的台式计算机(IP地址,例如172.20.1.73),Raspberry Pi可以访问位于C:\ wamp目录中的文件并运行一个功能。

但是,当我通过笔记本电脑和LAN电缆连接到学校网络(SIT.edu)并向Raspberry Pi的python脚本提供IP地址(例如172.20.1.74)时,Raspberry Pi上的控制台给出了HTTP 403 Forbidden的错误。我曾尝试禁用防火墙,但无济于事。任何帮助,将不胜感激。谢谢!

+0

难道是pi中的端口被另一个服务使用?尝试使用另一个端口号。 –

+0

@fp - 嗨,指定路径时,没有为台式计算机或我的笔记本电脑指定端口号。它被指定为http://172.20.1.74/webS.php – Jethro

+0

听起来像一个权限问题。确保该文件对连接到服务器的用户具有正确的权限。 –

回答

1

检查你的Apache。

编辑htpd.conf文件。在这里有一些语法告诉Apache允许哪些位置(IP地址)接受连接。

由于它的设计是一个开发系统,默认情况下,它只允许运行WAMP(Apache)的PC访问,即本地主机127.0.0.1和可能:: 1,取决于您使用的版本。

所以编辑httpd.conf文件(使用wampmanager菜单)

wampmanager -> Apache -> httpd.conf 

查找本节

<Directory "c:/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 None 

    # 
    # 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 localhost 
</Directory> 

现在,您将需要添加的IP或者机器的IP的访问你的Apache网络服务器。像这样做

# onlineoffline tag - don't remove 
    Order Deny,Allow 
    Deny from all 
    Allow from 127.0.0.1 localhost ::1 
    Allow from 172.20.1.74 
# Or you could allow any ip on a subnet by using just the forst 3 quartiles 
# Allow from 172.20.1 

如果您使用的是Apache 2.4,语法改变了这个如此哟ushould使用

# onlineoffline tag - don't remove 
# the equivalent of 127.0.0.1 localhost ::1 
    Require local 
# allowing by IP 
    Require ip 172.20.1.74 
# or for the whole subnet 
    Require ip 172.20.1 

请避免任何建议使用Allow from all我相信学校不希望你在他们的网络上打开另一个攻击媒介