CentOS 7.0 配置防火墙

2018-01-16 15:36:27

前一阵子被一个蜜汁 bug 困扰:Node.js 代码能在服务器上跑起来,但从浏览器却无法访问服务器 80 端口。于是在本地玩了一周。今天突然想到可能是防火墙的配置问题。

 

 

之前用的 iptables 来管理的防火墙,后来发现 CentOS 7.0 中已经用 firewalld 取代

iptables 了,于是与时俱进,停用了

iptables

 

systemctl stop iptables.service

 

然后来启动 firewalld

 

systemctl start firewalld.service

 

给我报了这个错

 

 

Failed to start firewalld.service: Unit firewalld.service is masked.

 

 

查了很久没找到解决办法,于是试着输入了下面这行命令,解决了。

 

systemctl unmask firewalld.service

 

启动 firewalld.service

 

systemctl start firewalld.service

 

80 端口添加到防火墙开放端口中

 

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

 

重启一遍 firewalld 服务使其生效

 

systemctl restart firewalld.service

 

检查更改是否生效

 

firewall-cmd --zone=public --query-port=80/tcp


 


  • 2018-01-20 20:33:58

    PHP中session_cache_limiter() 是什么意思啊

    session_cache_limiter('public'); session_cache_expire(30); session_start();第三个我晓得 前两个 网络上没找着资料 手册上全是英文的 翻译后 还是看不懂主要是没翻译正确

  • 2018-01-23 02:22:17

    andorid,把控件置于最顶端。bringToFront的意外发现

     bringToFront方法在SDK中的说明是“Change the view's z order in the tree, so it's on top of other sibling views”,翻译过来就是改变view的z轴,使其处在他父view的顶端。关于bringToFront的实现,网上有很多资料介绍,大体来说就是将这个view从父view中移除,然后再加入父view的顶端。具体实现如何呢?