0

I know that there is a lot about that in the web, but I somehow can't get this to work.

This is what I have done so far:

set up an apache2 web server in Ubuntu Mate 16.04. There is a website in /var/www/html which can be accessed through the internet.

I now have a folder, let's call it /media/user/drive/folder, which I want to make accessible through my website.

That's why I have created a symbolic link from /media/user/drive/folder to /var/www/html/folder. So when I open /var/www/html/ in caja, I see a link ./folder to /media/user/drive/folder.

I have also run 'sudo chown -R www-data: /media/user/drive/folder'.

I have the edited my apache2.conf and changed it to

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<Directory /media/user/drive/folder>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

I did sudo 'service apache2 restart' after the change.

When I now try to access www.mywebsite.com/folder, I still get a 403 Forbidden. Why is that, and how to get rid of it?

I have deleted browser's cache at least a hundred times, it's not about that.

Whe I move this folder into my /var/www/html and run the chown command accordingly, I can access it through my website. But that's not what I want, because folder's content may become quite large and drive is bigger than /.

  • 1
    What is the permission of the parent folder? They need to be +x for the user apache is running as, to allow apache to traverse them. – vidarlo Nov 11 '17 at 19:45
  • Does this answer help? Consider parent directory permissions also.. – Doug Smythies Nov 11 '17 at 19:46
  • namei -m /media/user/drive/folder

    returns

    ' drwxr-xr-x /
     drwxr-xr-x media
     drwxr-x--- user
     drwxr-xr-x drive
     drwxr-xr-x folder'
    
    

    , and www-data owns drive as well as folder. So permissions are okay like that?

    – FSchaefer Nov 11 '17 at 20:55
  • Please put "apache symlink security" into your favorite search engine, and read several of the results. – waltinator Nov 11 '17 at 21:18

0 Answers0