After a fresh install of Ubuntu, I am trying to change the localhost
directory of Apache2 (2.4.7). As always, it's not simple at all and it doesn't work right now.
Here's what I have done so far:
$sudo apt-get install apache2
Then in /etc/apache2/apache2.conf:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /home/louisro/Documents/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted
</Directory>
in /etc/apache2/sites-enabled/000-default.conf:
#DocumentRoot /var/www/html
DocumentRoot /home/louisro/Documents/www
in /etc/apache2/sites-available/000-default.conf:
#DocumentRoot /var/www/html
DocumentRoot /home/louisro/Documents/www
Then
$ sudo chmod go+r /home/louisro/Documents/www
$ sudo chown -R louisro:www-data /home/louisro/Documents/www
When I try to access localhost throught the browser, I get:
Forbidden
You don't have permission to access / on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
And the log gives:
$ cat /var/log/apache2/error.log
[Fri Jan 22 09:13:38.792577 2016] [core:error] [pid 12934:tid 140432965080832] (13)Permission denied: [client ::1:56772] AH00035: access to / denied (filesystem path '/home/louisro/Documents') because search permissions are missing on a component of the path
Best Answer
Here's what solved the problem: