apache网站无法访问,问题排查:
### 1、查看80端口是否被其他占用
`netstat -lnp|grep 80`
正确显示
```
tcp 0 0 :::80 :::* LISTEN 2539/httpd
tcp6 0 0 :::80 :::* LISTEN 2539/httpd
```
如果被其他应用程序占用,杀掉当前占用程序:
```
tcp/java 0 0 :::80 :::* LISTEN 4770
kill -9 4770
```
#### 确认是否关闭占用程序
``netstat -lnp|grep 80``
### 2、查看防火墙是否开放80端口
netstat -anp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1191/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1986/master
tcp 0 52 192.168.1.72:22 192.168.168.44:57430 ESTABLISHED 2317/sshd: root@pts
tcp6 0 0 :::80 :::* LISTEN 2539/httpd
tcp6 0 0 :::22 :::* LISTEN 1191/sshd
tcp6 0 0 :::88 :::* LISTEN 2539/httpd
tcp6 0 0 ::1:25 :::* LISTEN 1986/master
raw6 0 0 :::58 :::* 7 703/NetworkManage
此状态为 未开放 tcp 80端口
尝试开放80端口
1)查看防火墙状态
systemctl status firewalld
#开放80端口
[root@localhost error]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
#重启防火墙
[root@localhost error]# systemctl restart firewalld.service
问题解决