Fedora Core 4 and SELinux paranoia

The default configuration of Fedora Core 4 with SELinux enabled causes problems when you want to use the UserDir feature in Apache Httpd.

Problem:

SELinux is stopping the httpd processes from accessing your home directory.

CODE:
  1. Forbidden
  2.  
  3. You don't have permission to access /~foo/ on this server.
  4. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
  5. Apache/2.0.54 (Fedora) Server at localhost Port 80

Solution:

From your shell ...

CODE:
  1. [foo@localhost ~]$ chcon -R -t httpd_user_content_t public_html/

If you get the following...

CODE:
  1. [foo@localhost ~]$ chcon -R -t httpd_user_content_t public_html/
  2. chcon: failed to change context of public_html/index.html to root:object_r:httpd_user_content_t: Operation not permitted

It's probably because "index.html" is zero-length, I just placed an empty file in public_html and it failed first time, I removed the file and it went through the rest of it just fine.

Related Links:
http://the.taoofmac.com/space/Fedora
http://fedora.redhat.com/docs/selinux-faq-fc3/index.html#id2825658

No Comments so far
Leave a comment



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required, but not displayed publically)