selinux 允许apache访问文件

 •  Filed under centos, selinux
yum install -y policycoreutils-python

semanage fcontext -a -t httpd_sys_content_t /path/to/file
restorecon -v /path/to/file

semanage fcontext -a -t httpd_sys_content_t "/path/to/dir(/.*)?"
restorecon -R -v /path/to/dir