【发布时间】:2014-03-22 13:07:28
【问题描述】:
当 selinux 被禁用时,我可以从我的 amazon ec2 centos 实例上的 nfs 挂载卷访问 html 页面。但是当我启用它时,我得到“无法连接”错误。我已启用 httpd_use_nfs 和其他相关的布尔策略,但仍然遇到相同的错误。请帮我解决问题。我需要 apache 来使用 SELinux On 访问我的网页。
【问题讨论】:
-
/var/log/audit/audit.log 的审计日志中有什么内容?
-
感谢您的回复。这是 audit.log 的一部分
-
感谢您的响应。这里是与 httpd.type=AVC msg=audit(1392816609.757:94) 相关的一部分 audit.log:avc: denied { getattr } for pid=6424 comm=" httpd" path="/home/testman" dev=0:13 ino=393960 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:nfs_t:s0 tclass=dir./home/testman 是挂载点。原谅我的无知,我还需要查看日志文件中的其他内容吗?
-
嗯,httpd默认是无法访问home目录的,请看stackoverflow.com/questions/21566234/…如何开启。但是,我不建议以这种方式访问主目录。如果可能的话,宁愿挂载到另一个挂载点并贴上标签。或者看看,如何访问stackoverflow.com/questions/15795410/…中描述的标签目录
-
谢谢。将查看链接。
标签: amazon-ec2 centos selinux