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
本文详细介绍了在CentOS 7系统中如何通过修改配置文件来永久禁用SELinux,以及如何使用命令行工具临时开启或关闭SELinux。此外,还提供了在启用SELinux的情况下,如何为Nginx自定义目录进行正确权限设置的方法。

254

被折叠的 条评论
为什么被折叠?



