When accessing websites on your "localhost", there are several permissions which are required. The localhost content may be in your Sites directory, in which case, these commands may help prevent any "Forbidden" messages.
Ensure the Users directory allows read directory access:
cd /
sudo chmod -v 755 Users
Ensure the username directory allows read directory access:
cd Users
sudo chmod -v 755 username
Ensure your Sites directory allows read directory access:
cd ~
chmod -v 755 Sites
Every subdirectory of Sites needs read access:
cd ~/Sites
find ~/Sites -type d -print -exec chmod 755 {} \;
Every file in Sites and subdirectories needs read access:
cd ~/Sites
fing ~/Sites -type f -print -exec chmod 644 {} \;
Apache uses the _www group so, to give Apache full access to everything in the Sites directory, set the extended attributes with this:
chmod -R +a "group:_www allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" ~/Sites
~/Sites
folder, create at least one html file in it and try to access it viahttp://localhost/~user/the-file.html
?/Library/WebServer/Documents
) and create a symlink to it in your home folder.