SELinux:denied {执行}为pid = 2174 comm =“httpd”path =“/ etc / httpd / lib / libaprutil-1.so.0.5.3”

我有SELinux的问题。 setroubleshootbuild议启用mypol.ppsemodule -i mypol.pp所以Apache可以运行。

我运行build议的命令后,我不断得到:

 type=AVC msg=audit(1388119964.806:11): avc: denied { execute } for pid=2174 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3" dev=md0 ino=2228931 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_config_t:s0 tclass=file **** Invalid AVC allowed in current policy *** type=AVC msg=audit(1388120085.792:29): avc: denied { execute } for pid=2298 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3" dev=md0 ino=2228931 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_config_t:s0 tclass=file **** Invalid AVC allowed in current policy *** type=AVC msg=audit(1388120159.57:37): avc: denied { execute } for pid=2330 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3" dev=md0 ino=2228931 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_config_t:s0 tclass=file **** Invalid AVC allowed in current policy *** type=AVC msg=audit(1388121088.955:65): avc: denied { name_connect } for pid=2331 comm="httpd" dest=8080 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:http_cache_port_t:s0 tclass=tcp_socket **** Invalid AVC allowed in current policy *** found 0 alerts in /var/log/audit/audit.log 

下面告诉我你有一个重叠问题。

type=AVC msg=audit(1388119964.806:11): avc: denied { execute } for pid=2174 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3" dev=md0 ino=2228931 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_config_t:s0 tclass=file

/etc/httpd/lib是其他地方的符号链接吗? 通常你不会把你的库放在这里,而只是作为一个符号链接。 如果这样运行restorecon -Rv /usr/lib{,64}可能会有所帮助。

对于下面报告的第二个问题,你需要确保SELinux知道你期望从你的httpd服务中得到什么样的行为。

type=AVC msg=audit(1388121088.955:65): avc: denied { name_connect } for pid=2331 comm="httpd" dest=8080 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:http_cache_port_t:s0 tclass=tcp_socket

通过运行setsebool -P httpd_can_network_relay 1启用布尔型httpd_can_network_relay

我不知道**** Invalid AVC allowed in current policy ***消息中**** Invalid AVC allowed in current policy ******* Invalid AVC allowed in current policy ***但是我们已经在这里对此进行了问答

运行您通过audit2allow提供的文本build议

 #============= httpd_t ============== allow httpd_t http_cache_port_t:tcp_socket name_connect; allow httpd_t httpd_config_t:file execute; 

所以您可以尝试使用grep将相关的AVC拒绝消息提取到临时文件,然后将其传递到audit2allow

 grep denied: audit.log | grep httpd >temp.log cat temp.log | audit2allow -M myHTTPD ******************** IMPORTANT *********************** To make this policy package active, execute: semodule -i myHTTPD.pp 

安装myHTTPD.pp后,您仍然可能会发现SElinux停止启动httpd。 这是因为更早的(现在允许的)否认不再掩盖后者。 每次重复上面的过程。