【问题标题】:Selinux denying writing to /var/www/tmp even though the context is httpd_sys_rw_content_tSelinux 拒绝写入 /var/www/tmp 即使上下文是 httpd_sys_rw_content_t
【发布时间】:2018-08-30 05:22:55
【问题描述】:

问题:

httpd 无法写入/var/www/tmp,因为它被 SELinux 阻止。

描述:我用来从我的网站下载报告的 PDF 报告库抛出“Permission Denied”错误,因为它无法写入 /var/www/tmp。我已将phptmp 文件夹位置设置为/var/www/tmp/var/www/tmpapache 所有。它的上下文也被设置为httpd_sys_rw_content_t。仍然httpd无法写入此目录。

我错过了什么?

我已经使用以下命令设置了上下文和权限。

chown -R apache:apache /var/www/tmp semanage fcontext -a httpd_sys_rw_content_t "/var/www/tmp(/.*)?"

可能出了什么问题?请注意,我不想禁用 SELinux。

【问题讨论】:

    标签: apache selinux


    【解决方案1】:

    我认为应该在 semanage 命令中添加 -t 标志来指定类型。之后使用 restorecon -v 应用更改

    【讨论】:

      猜你喜欢
      • 2021-10-21
      • 2010-12-01
      • 2017-10-26
      • 2018-09-17
      • 1970-01-01
      • 1970-01-01
      • 2019-05-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多