3
SELinux阻止Apache写入文件
SELinux阻止apache用户写入其拥有的日志文件。当我这样做的setenforce 0时候。否则显示此错误 IOError: [Errno 13] Permission denied: '/var/www/webapp/k/site/k.log' 文件的安全上下文: $ ll -Z k.log -rw-r--r--. apache apache system_u:object_r:httpd_sys_content_t:s0 k.log 该文件是在SELinux模式设置为许可时创建的。 如何设置安全上下文,以便apache用户可以在该目录中写入?我确实使用设置了该目录安全性上下文,chcon但是找不到合适的文件类型。 来自audit.log: type=AVC msg=audit(1409945481.163:1561): avc: denied { append } for pid=16862 comm="httpd" name="k.log" dev="dm-1" ino=201614333 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file type=SYSCALL msg=audit(1409945481.163:1561): arch=c000003e syscall=2 success=no exit=-13 a0=7fa8080847a0 a1=441 a2=1b6 a3=3 items=0 ppid=15256 pid=16862 …