Apache 正在运行但网站没有加载

Apache 正在运行但网站没有加载

Apache 在我的服务器上正常运行,当我对服务器地址执行 ping 时,我只得到以下信息

PING 45.56.87.123 (45.56.87.123) 56(84) bytes of data

我的网站根本加载不上,我有一个虚拟的东西,http://45.56.87.123/test/index.html但根本无法访问那里的页面,

我的iptables:

[root@localhost test]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
ACCEPT     all  --  anywhere             anywhere            
REJECT     all  --  anywhere             loopback/8           reject-with icmp-port-unreachable
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ssh
ACCEPT     icmp --  anywhere             anywhere            
LOG        all  --  anywhere             anywhere             limit: avg 5/min burst 5 LOG level debug prefix "iptables denied: "
DROP       all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere      

关于如何使服务器正常运行,有什么帮助吗?

答案1

由于我无法添加评论(声誉低),我只能尝试粘贴答案。基本上,与服务器的连接超时了:

$ nc -vz 45.56.87.123 443
nc: connect to 45.56.87.123 port 443 (tcp) failed: Connection timed out

$ nc -vz 45.56.87.123 80
nc: connect to 45.56.87.123 port 80 (tcp) failed: Connection timed ou

iptables上面看到的规则中我没有发现任何错误,因此您可以先尝试检查您的服务是否正在监听该端口:

lsof -i :80
lsof -i :443

如果不是,那就是您的问题。如果是,则您还有防火墙问题,因此您可以尝试重新启动iptables。另外,您使用的是哪个操作系统?

本地主机的连接是否正常工作?例如:

curl http://45.56.87.123/test/index.html

或者

nc -vz 127.0.0.1 80
nc -vz 127.0.0.1 443

相关内容