Bug 449045

Summary: selinux-policy-targeted 3.3.1-55 prevents httpd from starting with non-standard DocumentRoot
Product: [Fedora] Fedora Reporter: Peter Blomgren <blomgren.peter>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-30 12:49:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Blomgren 2008-05-30 00:49:09 UTC
Description of problem:
Start of httpd fails with message

Starting httpd: Syntax error on line 280 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory


Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.3.1-55.fc9.noarch

How reproducible:
Always

Steps to Reproduce:
1. service httpd start
2.
3.
  
Actual results:
Starting httpd: Syntax error on line 280 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory


Expected results:
httpd starts

Additional info:
Line#280 is:
DocumentRoot "/home/myself/SYNC/public_html"

Raw Audit Messages:

host=[xxx] type=AVC msg=audit(1212108073.443:35): avc: denied { search } for
pid=4701 comm="httpd" name="SYNC" dev=sda8 ino=6398195
scontext=unconfined_u:system_r:httpd_t:s0
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir 

host=[xxx] type=SYSCALL msg=audit(1212108073.443:35): arch=c000003e syscall=4
success=no exit=-13 a0=7fbac939c218 a1=7fffd0b7b300 a2=7fffd0b7b300 a3=c items=0
ppid=4700 pid=4701 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0
fsgid=0 tty=pts1 ses=1 comm="httpd" exe="/usr/sbin/httpd"
subj=unconfined_u:system_r:httpd_t:s0 key=(null)

Comment 1 Daniel Walsh 2008-05-30 12:49:47 UTC
If you customize the settings on your machine, you also need to customize the
SELinux settings.  

Turn on the SELinux Boolean

setsebool -P httpd_enable_homedirs 1

Fix your labeleing

# semanage fcontext -a -t httpd_sys_content_t '/home/myself/SYNC/public_html(/.*)?'
# restorecon -R -v /home/myself/SYNC/public_html