nginx php 开启 SELinux 提示 Forbbiden 403

  1. 查看 nginx error.log查看到 index.php premission dead
  2. 查看 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
  3. 查看 nginx 默认文件 Security context ls -Z /usr/share/nginx/html显示
    root root system_u:object_r:httpd_sys_content_t:s0 index.html
  4. 修改对应权限chcon -R -u system_u -t httpd_sys_content_t filePath
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容