我是一个使用CentOS 7,nginix和php-fpm的服务器的新pipe理员。 有一个Web表单需要读取本地文件(prod.pem),然后build立一个出站连接:
gateway.push.apple.com:2195 gateway.sandbox.push.apple.com:2195
在audit.log中,我看到以下两个条目:
type=AVC msg=audit(1465918007.693:406): avc: denied { read } for pid=1796 comm="php-fpm" name="prod.pem" dev="dm-0" ino=19554 type=SYSCALL msg=audit(1465918007.693:406): arch=c000003e syscall=2 success=no exit=-13 a0=7fff2ee13570 a1=0 a2=1b6 a3=24 items=0 ppid=1213 pid=1796 auid=4294967295 uid=997 gid=996 euid=997 suid=997 fsuid=997 egid=996 sgid=996 fsgid=996 tty=(none) ses=4294967295 comm="php-fpm" exe="/usr/sbin/php-fpm" subj=system_u:system_r:httpd_t:s0 key=(null)
我的/etc/selinux/config :
SELINUX=enforcing SELINUXTYPE=targeted
我如何configurationSELinux以允许读取文件并进行出站连接? 我也想确保这些在重新启动时保留。
这对我来说是这样的:
setsebool -P httpd_read_user_content 1 setsebool -P httpd_can_network_connect 1
-P使其在重新启动时保持不变。