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 ?
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.
<Directory>
and / or <Location>
settings too, just changing the DocumentRoot
is not enough.
Commented
Aug 21, 2011 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/*
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...