Super User is a question and answer site for computer enthusiasts and power users. 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

I installed LAMP on Fedora 15. I tried to change the DocumentRoot to /home/USER/www, I changed it in the config file. Though it gave me 403 Forbidden error when i try to access the localhost.

How can I solve this issue ?

share|improve this question

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

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

The pretty way would be to edit


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .