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 "/var/www/x/common/uploads">
                Options +FollowSymLinks
                AllowOverride All
                Order allow,deny
                allow from all   

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.

  • 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 – Eugen Rieck Jul 16 '14 at 9:35

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.