5

Please help me figure this out, I'm out of options what to even google. No idea why this apache configuration is not working as I expected.

<VirtualHost *:80>        
        DocumentRoot "/var/www/x/frontend/www"
        ServerName test.dev
        Alias /uploads "/var/www/x/common/uploads"
        <Directory "/var/www/x/frontend/www">
                AllowOverride All
        </Directory>
        <Directory "/var/www/x/common/uploads">
                Options +FollowSymLinks
                AllowOverride All
                Order allow,deny
                allow from all   
        </Directory>
</VirtualHost>

Now, when accessing http://test.dev/uploads/something, I get 403 Forbidden. In apache error log:

"AH00037: Symbolic link not allowed or link target not accessible: /var/www/x/common/uploads/something"

/var/www/x/common/uploads/something is a symbolic link to /home/myusername/something, which is a remote folder mounted with sshfs.

/home/myusername/something has 755 permissions and everything inside it has 777 permissions.

1
  • First find out, if it is link-related or permission-related: Use Alias /uploads "/home/myusername/something" with a fitting <Direcotry> directive, retry and post results Commented Jul 16, 2014 at 9:35

1 Answer 1

4

I have two guesses:

  1. /home/myusername has 750 permissions, so Apache is not able to access subdirectories

  2. The mounted directory is still not accessible for other users (FUSE does it by default), try sshfs -o allow_other to fix that.

Anyway, you need to determine whether it is something wrong with the Apache configuration or the Apache server can't access the files. Try to do sudo -u www-data ls /var/www/x/common/uploads/something (change the www-data to a user under which the apache is running on your system). If you get an error, you need to fix permissions somewhere, otherwise there is something wrong with the configuration.

1
  • 1
    Turns out it was a permission problem (option 2 helped). Thanks! :)
    – Dalius
    Commented Jul 16, 2014 at 10:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .