SELinux is preventing /usr/sbin/httpd from write access on the directory /var/www/zjliu-newweb/lab-b...

操作系统:fedora16
通过网页登录phpbb出现如下错误:

SELinux is preventing /usr/sbin/httpd from write access on the directory /var/www/zjliu-newweb/lab-bbs/cache. For complete SELinux messages. run sealert -l c5ee521a-254e-4f43-8c34-67a5b0d10ea9
解决方法:
semanage fcontext -a -t httpd_sys_rw_content_t  /var/www/zjliu-newweb/lab-bbs/cache/
restorecon -v /var/www/zjliu-newweb/lab-bbs/cache
setsebool -P httpd_unified 1

转一篇文章:
SELinux is preventing /usr/sbin/httpd from 'write' accesses on the directory
/var/www/mod_pagespeed/cache.

***** Plugin httpd_write_content (92.2 confidence) suggests ****************

If you want to allow httpd to have write access on the cache directory
Then you need to change the label on '/var/www/mod_pagespeed/cache'
Do
# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/mod_pagespeed/cache'
# restorecon -v '/var/www/mod_pagespeed/cache'

***** Plugin catchall_boolean (7.83 confidence) suggests *******************

If you want to unify HTTPD handling of all content files.
Then you must tell SELinux about this by enabling the 'httpd_unified' boolean.
Do
setsebool -P httpd_unified 1

***** Plugin catchall (1.41 confidence) suggests ***************************

If you believe that httpd should be allowed write access on the cache directory
by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep /usr/sbin/httpd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context unconfined_u:system_r:httpd_t:s0
Target Context system_u:object_r:httpd_sys_content_t:s0
Target Objects /var/www/mod_pagespeed/cache [ dir ]
Source httpd
Source Path /usr/sbin/httpd
Port <Unknown>
Host (removed)
Source RPM Packages httpd-2.2.17-1.fc14
Target RPM Packages mod-pagespeed-beta-0.9.8.1-215
Policy RPM selinux-policy-3.9.7-18.fc14
Selinux Enabled True
Policy Type targeted
Enforcing Mode Enforcing
Host Name (removed)
Platform Linux (removed) 2.6.35.10-74.fc14.i686 #1 SMP Thu
Dec
23 16:17:40 UTC 2010 i686 i686
Alert Count 39
First Seen Tue 28 Dec 2010 10:50:22 PM PST
Last Seen Tue 28 Dec 2010 10:50:25 PM PST
Local ID 49e4329e-1ad9-4ba6-92e4-19ca0f3262aa

Raw Audit Messages
type=AVC msg=audit(1293605425.691:18135): avc: denied { write } for
pid=14233 comm="httpd" name="cache" dev=dm-0 ino=136159
scontext=unconfined_u:system_r:httpd_t:s0
tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=dir

httpd,httpd_t,httpd_sys_content_t,dir,write
type=SYSCALL msg=audit(1293605425.691:18135): arch=i386 syscall=mkdir
success=no exit=EACCES a0=b5d91c54 a1=1ff a2=ecb1e4 a3=b5d91c54 items=0
ppid=14086 pid=14233 auid=500 uid=48 gid=488 euid=48 suid=48 fsuid=48 egid=488
sgid=488 fsgid=488 tty=(none) ses=14 comm=httpd exe=/usr/sbin/httpd
subj=unconfined_u:system_r:httpd_t:s0 key=(null)
httpd,httpd_t,httpd_sys_content_t,dir,write

#============= httpd_t ==============
#!!!! This avc can be allowed using the boolean 'httpd_unified'

allow httpd_t httpd_sys_content_t:dir write;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值