Thursday, August 11, 2011

apache, nfs & selinux


apache, nfs & selinux

> I have an apache on FC3 that uses an NFS mounted document root from an
> FC1 server. Starting httpd on the FC3 system:
>
> service httpd start
> Starting httpd: Syntax error on line 265 of /etc/httpd/conf/httpd.conf:
> DocumentRoot must be a directory
>
> In /var/log/messages, I get:
>
> Jul 13 13:43:34 localhost kernel: audit(1121226214.986:0): avc: denied { search } 

> for pid=26466 exe=/usr/sbin/httpd name=/ dev=0:1a ino=6 
> scontext=root:system_r:httpd_t tcontext=system_u:object_r:nfs_t tclass=dir
>
> DocumentRoot is a directory. It seems to be a selinux permission
> thing. Does anyone have a suggestion on how to fix this?

Try mounting the DocumentRoot filesystem with the
"context=system_u:object_r:httpd_sys_content_t" filesystem option.

or

setsebool -P use_nfs_home_dirs=1
should also fix it.

No comments:

Post a Comment