I'm getting a 403 forbidden error when my webserver tries to load a file I created as 'root'.

If I chown and chgrp it to the right user name, it doesn't help. It also does't help if I chmod 777 the file

The only thing that works is using 'cp' while using the right user name and then deleting the original.

Any idea why?

I'm using Fedora, Apache 2. I am also using virtual hosts.

migrated from stackoverflow.com Feb 3 '11 at 20:39

This question came from our site for professional and enthusiast programmers.

  • Try this on ServerFault; you're more likely to get a good answer. – GWLlosa Feb 3 '11 at 20:29

Try disabling selinux:

setenforce 0

If that works then you need to decide what you want to do permanently about selinux. On/Off. That's going to depend on where your app is used, what it does, whether it has financial value, PCI requirements and so on.

Update This is probably the most used FAQ entry:


Wikipedia is the place to start reading:


There is a good FAQ on Fedora:


And if you are still buzzed about SELinux after all that you can spend a week with RedHat on their dedicated SELinux training course:


  • Awesome, it worked! Thank you. I know nothing about selinux... can you refer me to a good resource to study? – randylubin Feb 3 '11 at 20:58
  • I've edited the answer as per your request. Personally, I think it's worth spending some time to learn SELinux. – davey Feb 4 '11 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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