0

This is driving me nuts!

Just installed Ubuntu 14.04 with Apache 2.4.7. I've found a ton of posts on this issue but nothing seems to work. I do have ACLs enabled, but neither -b (removing entry) or adding permissions for www-data group worked. What's really bugging me is that I can't really tell where the problem is (I assume it is an apache issue though)?

Tried everything here: Apache 2.4 don't follow all symlinks

apache2.conf

<Directory /var/www/>
    Options +FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

sites-enabled/vhost.conf

<VirtualHost *:80>
    ServerName dev.net
    ServerAdmin webmaster@dev.net
    DocumentRoot /var/www/dev
    <Directory /var/www/dev/>
            Options +FollowSymLinks
            AllowOverride All
            Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.dev.log
    CustomLog ${APACHE_LOG_DIR}/access.dev.log combined
</VirtualHost>

ls -al /var/www

lrwxrwxrwx   1 root root   40 Sep 30 13:51 dev -> /home/yyyy/dev

sudo -u www-data ls -al /var/www/dev/

ls: cannot access /var/www/dev/: Permission denied

error log

[Tue Sep 30 14:16:22.508794 2014] [core:error] [pid 544] [client 127.0.0.1:52850] AH00037: Symbolic link not allowed or link target not accessible: /var/www/dev

These are the auth related enabled modules (these were enabled by default during install):

access_compat.load -> ../mods-available/access_compat.load
auth_basic.load -> ../mods-available/auth_basic.load
authn_core.load -> ../mods-available/authn_core.load
authn_file.load -> ../mods-available/authn_file.load
authz_core.load -> ../mods-available/authz_core.load
authz_host.load -> ../mods-available/authz_host.load
authz_user.load -> ../mods-available/authz_user.load

What am I doing wrong here?

SOLUTION

I figured this out. Hopefully my foolishness will save others some time. I forgot I had encrypted my home directory which I have not done in the past.

Once I took symlink out of the equation the log error changed which led me to the issue:

[Tue Sep 30 16:16:36.497015 2014] [core:error] [pid 2292] (13)Permission denied: [client 127.0.0.1:54012] AH00035: access to / denied (filesystem path '/home/yyyy/zzzz') because search permissions are missing on a component of the path

sure enough drwx------ /home/yyyy/zzzz

  • Tried sudo chown -R www-data:www-data /var/www as suggested, problem persists (checked sudo -u www-data... and through the browser). Thanks though. – bfuzze Sep 30 '14 at 19:30
0

Add www-data as owner and owner group:

sudo chown -R www-data:www-data /var/www

root user will always have read write permissions on whole filesystem by default.

--OR--

You can modify the user which is running the apache but it could hurt so I don't recommend that.

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.