![即使通过防火墙命令打开,Centos 7 端口 80 仍被阻止](https://linux22.com/image/695792/%E5%8D%B3%E4%BD%BF%E9%80%9A%E8%BF%87%E9%98%B2%E7%81%AB%E5%A2%99%E5%91%BD%E4%BB%A4%E6%89%93%E5%BC%80%EF%BC%8CCentos%207%20%E7%AB%AF%E5%8F%A3%2080%20%E4%BB%8D%E8%A2%AB%E9%98%BB%E6%AD%A2.png)
我正在尝试设置一个新的 Centos 7 Web 服务器,但似乎无法将端口 80 向外部开放。Apache 已安装并正在运行。我只是想获取启动页面,以便继续安装和配置。不幸的是,我在浏览 IP 时遇到超时,因为似乎端口 80 无法访问。
我在防火墙中打开了端口......
$ sudo firewall-cmd --zone=public --query-port=80/tcp
yes
$ sudo firewall-cmd --zone=public --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client http https ssh
ports: 80/tcp
protocols:
masquerade: no
forward-ports:
sourceports:
icmp-blocks:
rich rules:
我到底错过了什么?即使我关闭了防火墙,仍然会出现超时的情况。
$ telnet 70.61.231.4 80
Trying 70.61.231.4...
telnet: connect to address 70.61.231.4: Operation timed out
telnet: Unable to connect to remote host
这可能是 Apache 的问题,而不是防火墙的问题吗?
编辑:添加 netstat 详细信息和 curl 结果...
$ sudo netstat -tlnp | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 25835/httpd
$ curl 127.0.0.1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Apache HTTP Server Test Page powered by CentOS</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">