Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

SELinux is not allowing me to change the context of a symlink. I get no errors or anything. It just doesn't change the symlink, which I am guessing means it is resolving the symlink and changing that instead? coderoot is a symlink:

chcon -t httpd_sys_content_t /var/coderoot

This leaves the context of the symlink the same. When my application references the symlink SELinux jumps in and says no. With SElinux off it works fine. How can I fix this?

share|improve this question
up vote 7 down vote accepted

From the chcon(1) man page:

   -h, --no-dereference
          affect symbolic links instead of any referenced file
share|improve this answer
You sir are awesome. Thank you very much. – Joshua Enfield Jun 30 '10 at 20:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.