On my Ubuntu server, I've changed my /var/www directory to a subfolder inside of my home directory, and I'm now getting 403 "Forbidden" errors in my browser. I've read through a lot of similar questions, but none of the answers have worked for me. These are the steps I've followed:
In /etc/apache2/apache2.conf, I changed
<Directory /home/var/www>
To:
<Directory /home/bob/Dropbox/Uniserver/www>
I did the same thing in /etc/apache2/sites-available/000-default.conf:
DocumentRoot /var/www
To:
DocumentRoot /home/bob/Dropbox/UniServer/www
(Only for troubleshooting), I ran:
chmod 777 -R /home/bob/Dropbox/UniServer/www
I also ran:
chown -R www-data /home/bob/Dropbox/UniServer/www
Also for troubleshooting, I ran the same command for my entire home directory. I restarted Apache a million times:
sudo service apache2 restart
But typing 'localhost' into my browser still returns a 403 "Forbidden" error. Any ideas?
www-data
user/group to anything. Read-only access is enough, and is much preferred for security reasons. Sorry this doesn't answer your question though. – thomasrutter Dec 9 '14 at 6:25/var/log/apache2/error.log
(hope I'm remembering correctly) when this 403 forbidden error occurs? You may need to use sudo to even look in that log directory. – thomasrutter Dec 9 '14 at 6:27sudo -u www-data namei -l /home/bob/Dropbox/UniServer/www
? – muru Dec 9 '14 at 7:28