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

相關內容