0

There are a lot of posts out there but I could not resolve my issue. I symlinked an home folder to a localhost one, but when I try to run some php scripts that open a file that's in that folder I cannot access it. I tried to modify apache setting:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
<Directory /home/nyarlathotep/.config/garmin-extractor/3887499814/activities>
    Options FollowSymLinks Indexes
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>

that folder permissions are set to 777, but I still get "permission denied". What can I do? I'm not an apache expert for sure.

Vivek Jain
  • 3,811
  • 6
  • 30
  • 47
Aldo_U
  • 5
  • 6
  • possible duplicate of [Apache won't follow symlinks (403 Forbidden)](http://stackoverflow.com/questions/7381371/apache-wont-follow-symlinks-403-forbidden) – Benjamin Marwell Aug 13 '15 at 08:04

1 Answers1

0

First of all, do not use +FollowSymlinks. Details.

To answer your question: It depends. First of all, make sure the user is correct. So, if your apache runs as user www-run, then the group rights of the linked and targeted folder should have read and execute bits for the corresponding group set. Run this code to have execute (read) bits for everyone:

chmod o+x /home/ /home/nyarlathotep/ /home/nyarlathotep/.config/ /home/nyarlathotep/.config/garmin-extractor/ /home/nyarlathotep/.config/garmin-extractor/3887499814/ /home/nyarlathotep/.config/garmin-extractor/3887499814/activities

I'd recommend to put that config file to an other location where it cannot be read by other users. Or having apache run as your user.

Benjamin Marwell
  • 1,173
  • 1
  • 13
  • 36
  • I added my user to www-data group and checked if all the path give rwx permission to groups. Restarted apache and nothing. How can I use not FollowSymlinks? Now I have only edited apache2/site-enabled/000-default.conf – Aldo_U Aug 13 '15 at 09:22
  • I'm not saying you cannot use FollowSymlinks. It is just very unsafe. Does it still say 403 forbidden? What does the error log say? – Benjamin Marwell Aug 13 '15 at 09:26
  • Still forbidden. Are there any changes in apache2.conf? – Aldo_U Aug 13 '15 at 09:39