Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

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.

share|improve this question

migrated from 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
Thank you, it worked! – randylubin Feb 3 '11 at 21:00
up vote 3 down vote accepted

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:

share|improve this answer
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 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.