centos7搭建完nginx后禁用firewall防火墙和selinux
2017-10-15 23:34
651 查看
禁用firewall防火墙
firewall-cmd –state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
启用iptables防火墙
安装iptables服务,yum -y install iptables-services编辑iptables防火墙配置文件,开启80端口的访问权限,在
-A INPUT -p tcp -m state --state NEW -m tcp--dport 22 -j ACCEPT行的上面或者下面添加
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -jACCEPT
systemctl restart iptables.service #最后重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
禁用selinux
查看状态[root@centos7 nginx]# getenforce Enforcing
临时关闭 setenforce 0
临时开启 setenforce 1
永久关闭 vi /etc/selinux/config 修改SELINUX=disabled
重启系统
再次查看状态 sestatus或者getenforce
相关文章推荐
- firewall,iptablse和selinux防火墙
- CentOS7系统中关闭firewall,并使用iptables管理防火墙
- centos7最小化安装优化脚本(使用firewall防火墙)
- CentOS7 Firewall防火墙
- CentOS7,keepalived搭建双机热备(高可用、keepalived、Nginx、Haproxy、反向代理)
- 2.在centos7虚拟机搭建nginx网站
- Centos7 配置固定IP与关闭防火墙--关闭SELinux
- 使用Yum在CentOS7 下快速搭建Nginx Mysql PHP Discuz
- Centos7基础环境配置(为普通用户添加root权限/更换yum源/关闭防火墙/系统SELinux设置)
- [Linux]CentOS7搭建Nginx + MySQL + PHP
- hadoop环境搭建之关闭防火墙和SELinux
- rpm安装http,编译安装nginx,配置firewall防火墙
- CentOS7 Firewall防火墙详解
- centos7:Nginx+docker+springboot的环境搭建(一)
- centos7 firewall-cml 防火墙端口操作
- centos7 关闭firewall防火墙指令以及更换安装iptables并配置