Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I Installed Lamp on Fedora 15 . i tried to change the Document Root to /home/USER/www , i changed it in the config file . though it gave me 403 Forbidden error when i try to access the "local host "

How can i solve this issue ?

share|improve this question
add comment

3 Answers

You have changed the DocumentRoot setting but have not amended the associated <Directory> and / or <Location> tags in the configuration to allow access to the new location. Amend the paths within the appropriate tags and restart Apache and you'll be fine. See the Apache Manual for details.

share|improve this answer
    
i changed the DocumentRoot "/home/USER/www" & restart apache but still giving the same Error –  Hamza Aug 21 '11 at 7:10
    
You still need to change the existing <Directory> and / or <Location> settings too, just changing the DocumentRoot is not enough. –  Mike Insch Aug 21 '11 at 12:49
add comment

Did you make /home/USER/www/ world viewable? If apache tries to visit your new Document Root it might not have permission to view it.

chmod 711 /home/USER
chmod 755 /home/USER/www
chmod 644 /home/USER/www/*
share|improve this answer
add comment

The pretty way would be to edit

/etc/httpd/conf/httpd.conf

and have apache run as user 'USER' instead of user 'apache'. Since you want to have your files there it makes sense doesn't it?

It makes more sense than fiddling with chmod permissions which might end up creating more problems than solutions. I once chmoded the /home folder recursively on an aws ec2 instance to grant permissions to apache and then could not ssh into it anymore because of wrong permissions on my keys...

share|improve this answer
    
you point the fact of making sense, but does it have any impact globally or locally? what else does change resulting from this change? please be as clear as possible. –  Lorenzo Von Matterhorn Mar 16 '13 at 0:09
    
Well obviously if he puts his pages in USER's directory he might as well have them executed with USER's permissions... I reckon when he does his testing he's logged in as USER as well –  Homezar Mar 16 '13 at 0:32
    
i hope you understand its not for my sake i asked the above, but for future readers. –  Lorenzo Von Matterhorn Mar 16 '13 at 0:33
    
:) I know, and to answer I don't see any potential downfall of this method but I might be wrong –  Homezar Mar 16 '13 at 0:45
add comment

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.