Cannot access to CentOS from MS Windows via http

2019-09-05 07:38发布

问题:

I have got installed CentOS 7 under virtual envirment. It has proper hostname so I can ping it and it has acccess to internet inside of it and I can ping by IP and host name outside of it. Also It has working Apache and its test page is fine that has been checked locally.

Now I would like to get access to this test page from the MS Windows but I cannot. (I can ping CentOS by IP and hostname.)

Has it something to do with Iptables or firewall?

And this link doesnt help as well https://serverfault.com/questions/459267/enabling-http-access-on-port-80-for-centos-6-3-from-console

I assume some settings should be changed under CentOS but I am not sure which of them.

My question is which steps I have to execute to allow all those things?

回答1:

Either disable firewalld.service

systemctl disable firewalld.service
systemctl stop firewalld.service

Or allow access to port 80

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

Also disable SELINUX:

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


回答2:

So the answer is a simple one.

I just used Firewall settings to allow http and httpd.