搞定了Apache虚拟目录的SELinux权限

折腾了一个多小时,终于把Apache网站目录的SELinux权限搞定了~

我的SELinux模式是enforcing。

[root@CentOS /]# chcon -t httpd_sys_content_t /www
[root@CentOS /]# chcon -t httpd_sys_content_t /www -R
[root@CentOS /]# ls -Z /www/
drwxr-xr-x. root root unconfined_u:object_r:httpd_sys_content_t:s0 docs

就是说,只要把目录和文件的SELinux type(-t或者--type)设置成httpd_sys_content_t就行了。

原文地址:https://www.cnblogs.com/sztsian/p/2279637.html