Apache error: Symbolic link not allowed or link target not accessible

2.1k views Asked by At

I use Ubuntu as OS by default, but sometimes I need to use Windows 10 and would be convenient if I can have common access to all my web projects. I have two ssd for two OS. The first one only for Ubuntu (ext4 file system), the second one only for windows (ntfs file system). All projects store in the second one with ntfs file system (because in this case, I have access to the projects from windows and ubuntu). In Windows, it works well. But for Ubuntu, I have an issue.

In Ubuntu, I created a symlink "/var/www/" to "/media/myuser/projects/www". With the real folder ("/var/www/"), it works good, but with symlink doesn't work.

Error log:

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

I know that for have access to symlinks need to edit apache configuration and add option "FollowSymLinks". I did it, but it still doesn't work.

Apache configuration:

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

I'm sure that it ntfs mounting issue, because when I tried to add link "/var/www" to some ubuntu ext4 folder it worked.

Mounted devices with ntfs file system always have "0777" permissions, it means that issue doesn't relate to permissions.

$ ls -l /var/www
lrwxrwxrwx 1 myuser myuser 27 May 12 23:37 /var/www -> /media/myuser/projects/www/

Could you give me some advice with the apache ntfs mounting issue?

1

There are 1 answers

0
Walter Schrabmair On

I found a solution. You have to mount the NTFS SSD directly in /etc/fstab by a link to the /var/www. Then do mount -a . Then the SSD can be seen by apache in the Browser.