无法通过 http 从 MS Windows 访问 CentOS
Cannot access to CentOS from MS Windows via http
我在虚拟环境下安装了CentOS 7。
它有正确的主机名,所以我可以 ping 它,它可以访问它内部的互联网,我可以通过它外部的 IP 和主机名 ping。它也有工作的 Apache 并且它的测试页面很好,已经在本地检查过。
现在我想从 MS Windows 访问此测试页,但我不能。 (我可以通过 IP 和主机名 ping CentOS。)
与Iptables
或firewall
有关系吗?
这个link也没有帮助https://serverfault.com/questions/459267/enabling-http-access-on-port-80-for-centos-6-3-from-console
我假设某些设置应该在 CentOS 下更改,但我不确定是哪一个。
我的问题是我必须执行哪些步骤才能允许所有这些事情?
要么禁用 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
所以答案很简单。
我刚刚使用防火墙设置来允许 http 和 httpd。
我在虚拟环境下安装了CentOS 7。 它有正确的主机名,所以我可以 ping 它,它可以访问它内部的互联网,我可以通过它外部的 IP 和主机名 ping。它也有工作的 Apache 并且它的测试页面很好,已经在本地检查过。
现在我想从 MS Windows 访问此测试页,但我不能。 (我可以通过 IP 和主机名 ping CentOS。)
与Iptables
或firewall
有关系吗?
这个link也没有帮助https://serverfault.com/questions/459267/enabling-http-access-on-port-80-for-centos-6-3-from-console
我假设某些设置应该在 CentOS 下更改,但我不确定是哪一个。
我的问题是我必须执行哪些步骤才能允许所有这些事情?
要么禁用 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
所以答案很简单。
我刚刚使用防火墙设置来允许 http 和 httpd。