CentOS7Selinux设置

Selinux

vi /etc/sysconfig/selinux

SELINUX=enforcing
改为
SELINUX=disabled

临时关闭selinux setenforce 0

临时开启selinux
setenforce 1

查看 selinux
getenforce

nginx在开启Selinux时自定义目录

vi /etc/nginx/nginx.conf

user root;

chcon -R -u system_u /usr/share/nginx/html
chcon -R -t usr_t /usr/share/nginx/html

chcon -R -u system_u /root/dam/html
chcon -R -t usr_t /root/dam/html

原文地址:www.holdlg.com/post/centos…

你可能感兴趣的:(CentOS7Selinux设置)