403 Forbidden after changing DocumentRoot directory

apache server

Q. I am getting a Forbidden 403 error after I've changed the DocumentRoot in Apache for my domain. What do I do?

A. This is a security feature on the Apache running on Ubuntu (and Debian). The solution is quite simple:

 

Edit the apache2.conf (/etc/apache2/apache2.conf) and add the new directory to default security model:

<Directory /your/new/dir>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

Restart apache and you're done