记一次httpd服务启动正常,http服务死活不能访问的问题记录。
1.在linux下,使用ps和grep查看httpd服务

# ps aux | grep httpd
root      7579  0.0  0.0   3872   656 pts/1    S+   17:48   0:00 grep httpd
apache   12229  0.0  0.3  32940  7108 ?        S    04:03   0:00 /usr/sbin/httpd
apache   12230  0.0  0.3  33076  7680 ?        S    04:03   0:00 /usr/sbin/httpd
apache   12231  0.0  0.3  33076  7820 ?        S    04:03   0:00 /usr/sbin/httpd
apache   12232  0.0  0.3  33076  7176 ?        S    04:03   0:00 /usr/sbin/httpd
apache   12233  0.0  0.3  33076  7984 ?        S    04:03   0:00 /usr/sbin/httpd
apache   12234  0.0  0.3  33076  6760 ?        S    04:03   0:00 /usr/sbin/httpd
apache   12235  0.0  0.3  33076  7016 ?        S    04:03   0:00 /usr/sbin/httpd
apache   12236  0.0  0.3  33288  8288 ?        S    04:03   0:00 /usr/sbin/httpd
root     18009  0.0  0.5  32804 11820 ?        Ss   Mar21   0:00 /usr/sbin/httpd
apache   30098  0.0  0.3  33076  7000 ?        S    14:59   0:00 /usr/sbin/httpd

没啥说的,httpd服务已经启动正常,如果看不到httpd,服务没有启动成果
2.产看端口

netstat -anp | grep 80
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      12229/httpd         
tcp        0      0 xxx.xxx.xxx.xxx:48500         xxx.xxx.xxx.xxx:80            ESTABLISHED 1827/AliYunDun     

从上面看,httpd的端口80已经监听正常,但是客户端死活连不上,什么情况。

3.查看防火墙
对于不是运维的linux工作的人,已经头大了,只知道window玩防火墙,linux也使用防火墙?只能想到这里了,度娘linux防火墙管理方法,得到管理命令iptables,查看其服务开启方法

[xxxx]#service iptables status

如果得到是关闭状态,恭喜你,你的问题可以像我一样已经解决了。执行

[xxxx]#service iptables stop

在使用http请求80端口,就该能够使用了。
自己不是运维,并未配置过防火墙,导致花了好长时间不能弄懂为什么http不能访问的问题。记录下来。

GitHub 加速计划 / li / linux-dash
13
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:3 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐