我一直在使用Ubuntu,最近才开始在我的桌面(Ubuntu)的VMplayer中运行Centos (JavaLinuxRelease7.1.1503 (Core))。
curl http://localhost在CentOs命令行中)curl http://172.16.13.143/访问httpd时,它拒绝了TCP连接。我能够对它进行ssh,它对ssh ssh root@172.16.13.143工作正常。service iptables stopgetenforce。我只需要在网络界面上做一个快速测试,但我做不到,真的需要一些帮助。谢谢。
发布于 2015-07-30 21:03:40
安装在RHEL/CentOS/Fedora系统上的包不应该自动启动任何服务(因为您可能在配置完服务之后才准备好向世界公开您的服务)。
运行service httpd start将临时启动该服务,但在下次启动时不会启动。您希望systemctl enable httpd能够在启动系统时自动启动服务。
您可以检查防火墙是否真的被禁用。运行iptables -S查看当前规则集。默认iptables配置通常只允许ssh,而不允许其他任何配置。
更新
您的系统可能正在运行firewalld来管理防火墙。试试service firewalld stop。
您可以运行systemctl disable firewalld以防止下次系统启动时启动它。
发布于 2018-03-28 15:35:33
- CentOS 7
将以下内容添加到'/etc/httpd/conf/httpd.conf‘
Replace:
Listen 80
With:
Listen 0.0.0.0:80这将禁用ipv6并启用ipv4
若要检查此类型:
netstat -an | grep -i tcp | grep -i listen重新启动apache服务
systemctl restart httpd.service另外,启用防火墙访问端口80。
firewall-cmd --permanent --add-service=http
firewall-cmd --reload发布于 2016-10-25 04:18:20
你做了一个iptables -L来确保没有防火墙在运行吗?
执行以下命令,以确保没有其他防火墙也在运行
ps -ef"80“正在被聆听,所以有东西阻塞了你的连接
https://stackoverflow.com/questions/31733871
复制相似问题