无法通过http从MS Windows访问CentOS

时间:2015-12-03 13:40:14

标签: linux apache http configuration centos

我已经在虚拟环境下安装了CentOS 7。 它具有正确的主机名,所以我可以ping它并且它可以访问它内部的互联网,我可以通过它之外的IP和主机名ping。它也有工作Apache,它的测试页面很好,已在本地检查过。

现在我想从MS Windows访问此测试页面,但我不能。 (我可以通过IP和主机名ping CentOS。)

是否与Iptablesfirewall有关?

enter image description here

此链接也没有帮助https://serverfault.com/questions/459267/enabling-http-access-on-port-80-for-centos-6-3-from-console

我认为应该在CentOS下更改一些设置,但我不确定它们中的哪一个。

我的问题是我必须执行哪些步骤来允许所有这些事情?

2 个答案:

答案 0 :(得分:2)

禁用firewalld.service

systemctl disable firewalld.service
systemctl stop firewalld.service

或允许访问端口80

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

同时禁用SELINUX:

setenforce 0
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux

答案 1 :(得分:0)

所以答案很简单。

我刚刚使用防火墙设置来允许http和httpd。