I'm using Ubuntu 14.04, and have a problem with the Apache configuration:
I created a Symlink from /var/www/html
torwards /home/me/myWebDirectory
but localhost/myWebDirectory
renders a
403-permission denied
and in fact, sudo -u www-data ls /home/me/myWebDirectory
returns a permission denied too
apache2.conf had following directive :
<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
I changed it for <Directory /var/www/html>
, but no result.
I tried to add the me
user to www-data group
with this command sudo usermod -a -G groupName userName
, but that didn't help either
what is it that I missed?
EDIT:
I changed the group of /home/me/myWebDirectory
into www-data with rx rights, but no success either...
As I said, I was well aware that I had a reading permission problem as this sudo -u www-data ls /home/me/myWebDirectory
returning me a permission denied too (which means www-data doesn't have the rights to see what in it).
But I need certain point of your answer to be clearer :
Also you should use url "localhost/html" instead of "localhost/myWebDirectory".
Actually I've made the Symlink like follow :
cd /var/www/html
ln -s /home/user/me/myWebDirectory myWebDirectory
so I think accessing localhost/myWebDirectory
is the right address, no?
chown -R www-data:www-data /var/www/html
- since ubuntu 14.04, Apache DocRoot is
/var/www/html
, why should i chhange its owner (like many other deamons, roots by default). /localhost/testfile.html
works fine (undertsand testfile is in/var/www/html
)/localhost/phpmyadmin
works too, even if it's a SymLink to/usr/share
(while m trying to have a symLink to/home/user
...)
chmod +r /var/www/html # add read permission to dir
chmod +r /var/www/html/* # add read permission to files in dir
- Add read permission to who? to myUser?
- But that is exactly what I don't want to do.
- I actually want apache to be able to read in /home/me/myWebDirectory and not myUser to go write in apache's directories.
NB:
I know there's another way to do it, while activating the apache mod_userdir
and that's probably what i'll be going to do next.
But first i'd like to understand how to make this "simple" solution work...