Bug 149990 - SELinux breaks httpd
SELinux breaks httpd
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: httpd (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
: SELinux
: 149989 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2005-03-01 06:15 EST by Andrew Gormanly
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-02 14:55:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Apache config file (41.28 KB, text/plain)
2005-03-01 06:16 EST, Andrew Gormanly
no flags Details

  None (edit)
Description Andrew Gormanly 2005-03-01 06:15:14 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3) Gecko/20050104 Red Hat/1.4.3-3.0.7

Description of problem:
Having upgraded our web server to RHEL 4 AS, httpd refuses to start with SELinux enabled.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. service httpd start

Actual Results:  Apache fails to start with error message "DocumentRoot must be a directory".

Expected Results:  Apache starts normally and serves our sites.

Additional info:

The problem is one of directory nesting.  Our sites are held under
/home/www/cmmp /home/www/nano-science/nano-mag etc.

Nothing nested deeper than one level under /home will work, but errors are only
produced for those on the second level of nesting: e.g. a site in /home works, 
as does one in /home/www but one in /home/www/cmmp does not.  A site in 
/home/www/nano-science produces the error message, but one in 
/home/www/nano-science/nano-mag does not.

Turning off SELinux at boot with boot parameter selinux=0 fixes this, but is 
obviously not a nice solution...
Comment 1 Andrew Gormanly 2005-03-01 06:16:48 EST
Created attachment 111525 [details]
Apache config file

The httpd.conf in question
Comment 2 Andrew Gormanly 2005-03-01 06:18:21 EST
*** Bug 149989 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Gormanly 2005-03-01 06:19:36 EST
Apologies, I accidentally submitted this one twice.  I've killed the dupe.
Comment 4 Andrew Gormanly 2005-03-01 08:44:51 EST
Solved with:

chcon -R -t httpd_sys_content_t /home/www

Not sure if this is the best way to do this...
Comment 5 Joe Orton 2005-03-02 14:55:47 EST
Yes, that's the correct method.  You might be interested to read the following
guide, regarding SELinux/Apache integration.  It mostly applies to Red Hat
Enterprise Linux 4; a version specific for RHEL4 is in the works:


Note You need to log in before you can comment on or make changes to this bug.