服务器开放了80端口,但无法连接

3
我有一个问题一直在尝试解决,但是无法弄清楚发生了什么。我有多个 web 服务器,它们都安装了 apache。它们都在同一个网络中,但其中一个出现了问题。
我有三个服务器(.44、.45 和 .46)。
我可以通过 ssh 连接到 .44,并且可以毫无问题地 ping 通 .45 和 .46。然而,当我尝试测试并查看端口 80 是否打开时,.45 给了我这个消息。
 someadminuser@somelocation:/var/www$ telnet 10.0.0.45 80
 Trying 10.0.0.45...
 telnet: Unable to connect to remote host: Connection refused

以下是在.46上进行的相同测试。

 someadminuser@somelocation:/var/www$ telnet 10.0.0.46 80
 Trying 10.0.0.46...
 Connected to 10.0.0.46.
 Escape character is '^]'.

我通过ssh登录到.45来查看端口。

 someadminuser@somelocation:~$ netstat -tulpn | grep :80
 (No info could be read for "-p": geteuid()=1000 but you should be root.)
 tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN


 someadminuser@somelocation:~$ sudo iptables -L
 Chain INPUT (policy ACCEPT)
 target     prot opt source               destination          
 ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:httpflags: 
 ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
 ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
 ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
 ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http

非常感谢任何帮助。

****************更新****************

我保存了我的ipv4表格,这是我得到的内容:

 # Generated by iptables-save v1.4.12 on Thu May 29 14:05:31 2014
 *nat
 :PREROUTING ACCEPT [3416:231940]
 :INPUT ACCEPT [1175:75880]
 :OUTPUT ACCEPT [337:25196]
 :POSTROUTING ACCEPT [337:25196]
 -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3000
 -A OUTPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3000

当然,这还有更多的内容,但是这部分看起来很可疑。
1个回答

0

所以服务器正在将连接重定向到本地端口80到本地端口3000。 可能在端口3000上没有任何正在侦听的内容,这就是为什么您看到“连接被拒绝”的原因。

如果工作服务器没有此配置,则需要删除(或修复)iptables。 如果其他服务器有该配置,则需要确定它们在端口3000上运行的内容以及失败的服务器为何没有相同的内容。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接