linux找不到iptables
//关闭防火墙,安装或更新服务,打开iptables
systemctl stop firewalld
yum install iptables-services
systemctl enable iptables
systemctl start iptables
service iptables save
有时候linux版本不同,iptables不可用,只能用firewalld替代
防火墙是整个数据包进入主机前的第一道关卡。Iptables和firewalld只能开一个。 需要先屏蔽一个
//停止并屏蔽iptables:
systemctl stop iptables
systemctl mask iptables
//安装、解除屏蔽并启动firewalld
yum install firewalld
systemctl unmask firewalld
systemctl start firewalld
systemctl status firewalld
//设置开机启动
systemctl enable firewalld
设置开机启动
通过修改/etc/rc.local
文件可以设置activemq开机启动
cd /usr/server/backup/activemq/bin/ && ./activemq start
如果安装在非root账户下,加上
sudo changhf -c '/usr/server/backup/activemq/bin/activemq start'
设置之前先验证下修改该文件是否生效
systemctl list-dependencies multi-user.target | grep rc-local
//执行上面命令如果没有输出结果,执行如下命令后再次测试
chmod +x /etc/rc.d/rc.local
systemctl daemon-reload
systemctl
systemctl实际上是将service 和 chkconfig两个命令组合在一起
systemctl enable firewalld.service //设置开机启动防火墙
systemctl disable firewalld.service //设置开机不启动防火墙
//常用操作
systemctl start|stop|restart|status|enable|disable firewalld.service