网关超时:重启后无法连接到远程主机

时间:2015-10-26 15:56:15

标签: apache apache2

我在CentOS 6.7 VM上运行apache2。我的PHP网站在重启之前工作正常,但之后我得到了504网关超时。

$ telnet <MYIP> 80
Trying <MYIP>...
Connected to <MYHOSTNAME>.
Escape character is '^]'.
HTTP/1.0 504 Gateway Timeout

Gateway Timeout: can't connect to remote host
Connection closed by foreign host.

我一直在谷歌搜索几个小时但找不到任何有用的东西。该网站在本地工作,即如果我忘了http://localhost:80/

我的iptables如下:

$ sudo netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1556/rpcbind
tcp        0      0 0.0.0.0:35443               0.0.0.0:*                   LISTEN      1578/rpc.statd
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1745/sshd
tcp        0      0 127.0.0.1:5432              0.0.0.0:*                   LISTEN      1782/postmaster
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1866/master
tcp        0      0 ::ffff:127.0.0.1:8005       :::*                        LISTEN      2736/java
tcp        0      0 :::8009                     :::*                        LISTEN      2736/java
tcp        0      0 :::111                      :::*                        LISTEN      1556/rpcbind
tcp        0      0 :::80                       :::*                        LISTEN      2854/httpd
tcp        0      0 :::8080                     :::*                        LISTEN      2736/java
tcp        0      0 :::54644                    :::*                        LISTEN      1578/rpc.statd
tcp        0      0 :::22                       :::*                        LISTEN      1745/sshd
tcp        0      0 ::1:5432                    :::*                        LISTEN      1782/postmaster
tcp        0      0 ::1:25                      :::*                        LISTEN      1866/master
    enter code here

任何想法可能出错或如何排除故障?

1 个答案:

答案 0 :(得分:0)

多次重新启动apache并尝试再次设置防火墙规则后,我又重新启动了它,并且它运行良好。

我不知道问题是什么,如果有人知道,那么仍然感兴趣。