简体   繁体   English

Windows 7:如何配置XAMPP / Windows防火墙/ McAfee /专用网络路由器以允许传入的外部HTTP / HTTPS连接?

[英]Windows 7: How to configure XAMPP / Windows Firewall / McAfee / private network router to allow incoming external HTTP/HTTPS connections?

I have been trying to follow this brief tutorial to enable external HTTP/HTTPS access to my XAMPP's Apache Web Server on Windows 7. However, when I go to Control Panel -> Windows Firewall, the four entries in bold font as shown in the image below cannot be clicked (these entries will not even change color when hovered with the mouse). 我一直在尝试按照这个简短的教程来启用对Windows 7上XAMPP的Apache Web服务器的外部HTTP / HTTPS访问。但是,当我转到“控制面板”->“ Windows防火墙”时,四个条目以粗体显示,如图所示。不能单击下面的(用鼠标悬停时这些条目甚至不会更改颜色)。

在此处输入图片说明

  1. Why can't I click these entries? 为什么我不能单击这些条目? Was it McAfee that was somehow responsible for disabling these? 是由McAfee负责以某种方式禁用了这些功能吗? How can I change the settings back so that these links are enabled? 如何改回设置以启用这些链接?

  2. So, perhaps there is some other way of accomplishing what I'm trying to do. 因此,也许还有其他方法可以完成我想做的事情。 When I click on Advanced Settings (which on this screen appears as Impostazioni Avanzate), I get the following window, but I'm not sure which entry corresponds to allowing TCP/UDP connections on ports 80 and 443 (HTTP and HTTPS). 当我单击“高级设置”(此屏幕上显示为Impostazioni Avanzate)时,出现以下窗口,但是我不确定哪个条目对应于允许端口80和443(HTTP和HTTPS)上的TCP / UDP连接。 Anyone know which entry I should select in the second screen below and how to proceed? 有人知道我应该在下面的第二个屏幕中选择哪个条目以及如何进行吗?

在此处输入图片说明

在此处输入图片说明

Anyways, I've tried adding a rule for entering connections and specifying pors 80 and 443 within such rule, but after adding the rule I still couldn't connect via HTTP/HTTPS to my local website from the computer in the other room. 无论如何,我尝试添加一个用于输入连接的规则,并在该规则中指定pors 80和443,但是添加规则后,我仍然无法通过HTTP / HTTPS从另一间房间的计算机连接到我的本地网站。 I've even tried the somewhat extreme step of disabling the firewall in public profile under Actions -> Properties, but that still didn't work. 我什至尝试了一些极端的步骤,即在“操作”->“属性”下禁用公共配置文件中的防火墙,但这仍然行不通。 What have I done wrong? 我做错了什么?


Update: I can connect to my Windows 7 PC website from my mobile phone via Wi-Fi using the private IP address space by entering http://192.168.1.68/ into the browser's address bar (I got this IP address from the ipconfig command). 更新:通过在浏览器的地址栏中输入http://192.168.1.68/我可以使用私有IP地址空间通过Wi-Fi通过手机连接到Windows 7 PC网站(我从ipconfig命令获得了此IP地址) )。 I can also connect to the router via Wi-Fi by entering the router's private IP into the browser's address bar using the URL http://192.168.1.254/ . 我还可以通过使用URL http://192.168.1.254/在浏览器的地址栏中输入路由器的专用IP来通过Wi-Fi连接到路由器。 Once connected I was able to configure the router so that incoming HTTP, HTTPS, and SSH connections are redirected to my computer when connecting to the router via the external address http://2.234.xx which I was able to find out from the router's web interface (such router's external address could not be obtained from the PC using ipconfig , and a command such as C:\\Windows\\System32\\tracert www.google.com is also useless for this task because it displays the IP addresses on the wrong side, so that the inner IP address of the router is reported and not its outer IP address). 连接后,我便可以配置路由器,以便在通过外部地址http://2.234.xx连接到路由器时,可以将传入的HTTP,HTTPS和SSH连接重定向到我的计算机,我可以从路由器的地址中找到该地址。 Web界面(无法使用ipconfig从PC获得此类路由器的外部地址,并且诸如C:\\Windows\\System32\\tracert www.google.com对于此任务也无济于事,因为它会显示错误的IP地址侧,以便报告路由器的内部IP地址,而不是其外部IP地址)。

So now, connecting to the PC running XAMPP using its external IP address (which works both using Wi-Fi as well as coming from the Internet and mobile phone operator networks connected to the Internet), I get the following error message from XAMPP: 因此,现在,使用其外部IP地址连接到运行XAMPP的PC(既可以使用Wi-Fi,也可以来自Internet和连接到Internet的移动电话运营商网络),我从XAMPP收到以下错误消息:

在此处输入图片说明

Any help with resolving this issue will be greatly appreciated. 解决此问题的任何帮助将不胜感激。

Thanks. 谢谢。

I've solved the problem: 我已经解决了这个问题:

I am running XAMPP 1.8.3. 我正在运行XAMPP 1.8.3。 I've opened C:\\xampp\\apache\\conf\\extra\\httpd-xampp.conf and at the bottom of the file commented out the following lines: 我打开了C:\\xampp\\apache\\conf\\extra\\httpd-xampp.conf并在文件底部注释了以下几行:

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Order deny,allow
    Deny from all
    Allow from ::1 127.0.0.0/8 \
        fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
        fe80::/10 169.254.0.0/16

    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

like so: 像这样:

#
# New XAMPP security concept
#
#<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
#   Order deny,allow
#   Deny from all
#   Allow from ::1 127.0.0.0/8 \
#       fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
#       fe80::/10 169.254.0.0/16
#
#   ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
#</LocationMatch>

I then restarted Apache in the XAMPP Control Panel for the changes to take effect. 然后,我在XAMPP控制面板中重新启动了Apache,以使更改生效。

Regards! 问候!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM