SELinux policy enabled; httpd running as context unconfined_u:system

来源:互联网 发布:数据挖掘异常检测方法 编辑:程序博客网 时间:2024/06/07 03:46
CentOS6.0 下默认开selinux时出现httpd 报“SELinux policy enabled; httpd running as context unconfined_u:system”的解决方案
安装audit2allow 参看http://wiki.eri.ucsb.edu/sysadm/SELinux
yum install policycoreutils-python

To allow httpd to use nfs dirs in CentOS-6

setsebool -P httpd_use_nfs 1setsebool -P httpd_enable_homedirs 1

文章来源: http://www.xinotes.org/notes/note/1156/
Open /var/log/httpd/error_log, you may see a line like this: 
[Wed Apr 13 15:50:35 2011] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
These are the steps to fix: 
  1. If the directory resides in a user home directory: 
    # setsebool -P httpd_read_user_content 1

  2. Create a policy package from the audit log: 
    # grep httpd /var/log/audit/audit.log | audit2allow -M mypol******************** IMPORTANT ***********************To make this policy package active, execute:semodule -i mypol.pp

  3. Apply the policy package just created 
    # semodule -i mypol.pp

  4. Restart apache httpd: 
    # apachectl restart