编辑/etc/firewalld/zones/public.xml
若没有,则创建
加入如下代码
<?xml version=”1.0″ encoding=”utf-8″?>
<zone>
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<service name=”http”/>
<service name=”ssh”/>
<service name=”https”/>
</zone>
然后你就能访问了。这里的service不是咱们通常意义上的httpd 而是指http服务。在80端口提供http服务。下面的ssh还有https也一样。
当然还有另外一种方法
firewall-cmd –permanent –add-port=80/tcp
systemctl restart firewalld.service
也可以如评论下面的兄弟所说的那种,效果也不错~
未经允许不得转载:啊福主机 » firewalld 开80端口