Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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:

http://docs.fedoraproject.org/en-US/Fedora/13/html/SELinux_FAQ/index.html#id4621659

Wikipedia is the place to start reading:

http://en.wikipedia.org/wiki/Security-Enhanced_Linux

There is a good FAQ on Fedora:

http://docs.fedoraproject.org/en-US/Fedora/13/html/SELinux_FAQ/

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

https://www.redhat.com/courses/rhs429_red_hat_enterprise_selinux_policy_administration/

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

 
discard

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.