XAMPP Apache 服务器无法在内部网络上运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2123827/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
XAMPP Apache server not working on internal network
提问by user3930756
I have XAMPP installed on my local laptop (Vista) and it works fine. Apache and MySQL are running as services, and I can get to both http://localhost/and http://192.168.2.2/without any hassles.
我在本地笔记本电脑 (Vista) 上安装了 XAMPP,它运行良好。Apache 和 MySQL 作为服务运行,我可以轻松访问http://localhost/和http://192.168.2.2/。
However, if I try accessing the server from another laptop on my internal network by typing in the http://192.168.2.2/ip address, it errorstimes out. What am I missing here?
但是,如果我尝试通过输入http://192.168.2.2/ip 地址从我内部网络上的另一台笔记本电脑访问服务器,它错误超时。我在这里错过了什么?
When I run Port Check, I get the following:
当我运行端口检查时,我得到以下信息:
Service Port Status
==============================================================================
Apache (HTTP) 80 Program: C:\xampp\xampp\apache\bin\httpd.exe
Apache (WebDAV) 81 free
Apache (HTTPS) 443 Program: C:\xampp\xampp\apache\bin\httpd.exe
MySQL 3306 Program: C:\Program Files\MySQL\MySQL Server 5.1\bin
\mysqld.exe
and when I try telnetting to localhost port 80, that works too. My httpd-vhosts.conf file contains the following lines:
当我尝试 telnet 到 localhost 端口 80 时,这也有效。我的 httpd-vhosts.conf 文件包含以下几行:
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/xampp/htdocs/"
</VirtualHost>
<VirtualHost 192.168.2.2>
ServerName localhost
DocumentRoot "C:/xampp/xampp/htdocs/"
</VirtualHost>
Any thoughts?
有什么想法吗?
采纳答案by user3930756
Answered via help at ServerFault.com
通过 ServerFault.com 上的帮助回答
The problem was that the Windows Firewall had port 80 blocked. To fix this, I opened Windows Firewall, clicked Change Settings, went to the Exceptions tab, and then "Add Port". I set Name to "Web Server (TCP 80)", Port Number to 80, and Protocol to TCP and that was it.
问题是 Windows 防火墙阻止了端口 80。为了解决这个问题,我打开了 Windows 防火墙,单击了更改设置,转到了例外选项卡,然后是“添加端口”。我将名称设置为“Web 服务器(TCP 80)”,端口号设置为 80,协议设置为 TCP,仅此而已。

