Thursday, 26 December 2019

linux - Apache 2.4 don't follow all symlinks


I'm configuring my local Apache webserver after a fresh Kubuntu 14.04 install. Apache version is 2.4.7.


I usually work with files located in a separated partition (/dev/sdb6 here), and create symbolic links into /var/www/ folder.


The fact is it does only works with symlinks pointing to /home/user/someFolder, but it doesn't with folders located on the partition. This partition is ext4, and mounted in media/user/partitionName. This directory is owned by my user, and has x permission bits for every subfolders. The user www-data is assigned to my group, and my user is assigned to group www-data.


The apache2.conf file (and all eventual other vhosts conf files) have the FollowSymLinks option for the directive.


What do I miss ? The weird thing is that it follows the symlinks pointing to /home/user/something... But not the ones pointing to another location. This result in a:


AH00037: Symbolic link not allowed or link target not accessible: /var/www/somelink

I even tried to add the option -SymLinksIfOwnerMatch to be sure it doesn't have to be the same user for the target (even if I know it's the same), but no change.



Answer



My first hunch would be ACLs, assuming you have the POSIX permissions already set up correctly. Check if you've mounted this partition with ACLs enabled.


If you want to do some further testing, you should su into the webserver user (www-data) and run some ls commands to see if that works. For example, sudo -u www-data ls /path/to/folder.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...