Apache侦听器端口不在外部工作

时间:2013-12-28 19:02:30

标签: windows apache listener

我正在尝试在我的Win8 Pro PC上为我的本地主机添加一些监听器,这样我就可以使用智能手机或平板电脑输入不同的vHost。例如,需要测试我的响应式设计等。

例如,我在http-vhosts.conf中得到了这个:

    <VirtualHost *:80>
    DocumentRoot "G:/XAMPP/xampp/htdocs/path/to/project"
    ServerName sprout.x
    DirectoryIndex index.html index.php
    <Directory "G:/XAMPP/xampp/htdocs/path/to/project">
        Options Indexes FollowSymLinks Includes ExecCGI
        Order allow,deny
        Allow from all
        AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:5000>
    DocumentRoot "G:/XAMPP/xampp/htdocs/path/to/project"
</VirtualHost>

这是我在httpd.conf中的内容:

Listen 80
Listen 5000

当我从台式电脑输入时,我可以使用:http://localhost:5000/

来访问它

当我尝试从平板电脑等其他设备输入时 - 我在同一个网络中 - 我总是到达我的台式机的本地主机:http://192.168.2.124:5000

希望我确实解释过,所以任何人都明白我的意思。正如您所看到的,我唯一的问题是侦听端口5000(例如)不能从外部工作。有没有人有想法?

感谢您提供任何帮助!

1 个答案:

答案 0 :(得分:0)

99%这可能只是Windows防火墙。

从Windows控制面板打开防火墙设置。单击“通过Windows防火墙允许和应用程序或功能”。然后单击“更改设置”,然后单击“允许其他应用程序...”按钮。选择Apache.exe二进制文件。

或者,您可以从第一个防火墙控制面板屏幕中选择“高级设置”,右键单击“入站规则”,然后选择“新规则”。然后通过向导来允许Apache(或者只启用端口80和5000)。

那应该这样做。