Cannot access to CentOS from MS Windows via http

自作多情 提交于 2020-01-07 09:03:20

问题


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.



来源:https://stackoverflow.com/questions/34067552/cannot-access-to-centos-from-ms-windows-via-http

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!