nginx php 开启 SELinux 提示 Forbbide
2018-09-19 本文已影响21人
紅塵忘
- 查看 nginx
error.log
查看到index.php premission dead
- 查看 SELinux log
/var/log/aduit.log
提示denied { open } scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file
- 查看 nginx 默认文件 Security context
ls -Z /usr/share/nginx/html
显示
root root system_u:object_r:httpd_sys_content_t:s0 index.html
- 修改对应权限
chcon -R -u system_u -t httpd_sys_content_t filePath