【问题标题】:Cannot access with IP from other devices, localhost server on MAC无法从其他设备使用 IP 访问,MAC 上的 localhost 服务器
【发布时间】:2015-11-07 17:36:42
【问题描述】:

我已将默认本地主机服务器设置为使用默认设置在我的 MAC 上运行 apache。我可以使用 localhost 和它自己的服务器的 IP 访问本地服务器,但不能使用通过简单路由器连接在同一 WIFI 网络上的 IP 从另一台 PC 访问。 我已经禁用了mac上的防火墙,但没有。 这是我的 /etc/hosts 文件:

127.0.0.1   localhost
255.255.255.255   broadcasthost 
::1             localhost 

wifi上的mac IP是192.168.10.102,其他PC IP是192.168.10.105 Apache 设置为监听 80 端口,http.conf

Listen 80

sudo tcpdump -i en0 结果:

15:35:28.384152 IP 192.168.10.105.63630 > 192.168.10.102.http: Flags [S], seq 2700046236, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
15:35:28.674606 IP 192.168.10.105.63631 > 192.168.10.102.http: Flags [S], seq 3459374519, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
15:35:29.335909 IP 192.168.10.102.51270 > 192.168.10.1.domain: 50623+ PTR? 103.10.168.192.in-addr.arpa. (45)
15:35:29.343300 IP 192.168.10.1.domain > 192.168.10.102.51270: 50623 NXDomain* 0/1/0 (95)
15:35:29.593550 IP 192.168.10.105.netbios-dgm > 192.168.10.255.netbios-dgm: NBT UDP PACKET(138)
15:35:30.345378 IP 192.168.10.102.58188 > 192.168.10.1.domain: 60091+ PTR? 255.10.168.192.in-addr.arpa. (45)
15:35:30.352597 IP 192.168.10.1.domain > 192.168.10.102.58188: 60091 NXDomain* 0/1/0 (95)
15:35:31.337113 ARP, Request who-has 192.168.10.102 tell 192.168.10.1, length 28

注意 在重新启动 MAC 计算机几秒钟后,我可以使用来自另一台计算机的 IP 访问 localhost 服务器... MAC 还安装了赛门铁克端点保护,即使我有 sudo 权限,我也找不到禁用它的方法。

有什么想法吗?

【问题讨论】:

    标签: macos apache


    【解决方案1】:

    在失去将近 1 天半的时间后,我发现赛门铁克的 Endpoint Security 阻止了传入连接。我遇到了这个脚本,它节省了我的时间(禁用服务):

    https://gist.github.com/phoob/671e65332c86682d5674

    这也是有效的:

    https://gist.github.com/bubenkoff/4043130

    希望能帮助别人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-01
      • 1970-01-01
      • 2013-02-24
      • 2012-06-21
      • 1970-01-01
      • 2015-09-14
      • 2021-11-17
      • 2015-04-23
      相关资源
      最近更新 更多