Symbolic Links within File System Repository

Symbolic Links within File System Repository

by Jeff White -
Number of replies: 5
I am currently working with Moodle 2.8.7 and I am having a lot of issues with setting up a file system repository that uses symbolic links everywhere. 


I am able to make a symbolic link in moodlata/repository/example_folder with no problem but the issues is when I have a symbolic link within the example_folder. Here is a hypothetical example on how it is set up:

ln -s /example_folder /moodledata/repository/example_sym

the example_folder then has symbolic links pointing to multiple dept folders:

/example_folder/dept1 -> /nas_1/dept1

/example_folder/dept2 -> /nas_1/dept2

/example_folder/dept3 -> /nas_1/dept3

There are no permission issues and I can navigate with this link within shell as the apache user with no problem. 

When I attempt to dig into the sub folders in File picker, the symbolic links just loop back to their parent folder. 

File Picker Screenshot

Has anyone else encountered this? What was your work around? 

Average of ratings: -
In reply to Jeff White

Re: Symbolic Links within File System Repository

by Hermann Klocker-Mark -

Sorry - no solution, only exactly the same problem. Since storing files in repos on external media is a very reasonable idea it's a pity that this seems not to be working.

Have you got a solution in the meantime?

In reply to Hermann Klocker-Mark

Re: Symbolic Links within File System Repository

by Jeff White -

Hi,

I never found a solution I was happy with but making a individual repo for each folder that was a symbolic link will allow Moodle's GUI to access the directory. I hope you do not have a rats nest of symbolic links all over your storage location sad

I have not played with this in a while but maybe there is something better out there than just making symbolic links to folders. Perhaps a setting I overlooked in php or httpd when I first reported this issue. 

In reply to Jeff White

Re: Symbolic Links within File System Repository

by Hermann Klocker-Mark -
Thank you for your answer. I don't even get your solution working. Using symlinks to sshfs mounted directories (mount output) 


remoteuser@remote-ssh.services.somewhere.com:/data/files/ext/ on /mnt/here type fuse.sshfs


works flawlessly on OS level - this is the linking:


lrwxrwxrwx  1 www-data www-data    9 Jun 30 05:43 FarFarAway -> /mnt/here


and this is using while cding into it:


root@server:/var/www/moodledata/repository/FarFarAway# ls -lah

total 857M

drwxrwxr-x 1 www-data www-data 4.0K Jun 28 18:43 .

drwxr-xr-x 3 root     root     4.0K Jun 30 15:48 ..

-rwxrwxrwx 1 www-data www-data    9 Jun 28 06:23 ho.txt


while it is not even seen by moodle.

In reply to Hermann Klocker-Mark

Re: Symbolic Links within File System Repository

by Jeff White -
Make sure httpd has at least r-x rights to every directory it needs to navigate to. 


My setup was set up something like this

/nas  is mounted on the server. I am not sure what service my company used nor really cared. I was just happy it worked. 

/moodledata/repository was set up like this:

ln -s /nas/dept/folder1 /moodledata/repository/symlink1

ln -s /nas/dept/team1/folder2 /moodledata/repository/symlink2

Note I am pretty sure every subdirectory needs to have at least r-x for other for Apache to access it. Hopefully another server guy can correct me if I am wrong. 

I used full paths to make things easier for me. 

Create a repository in Moodle Repo called: 

symlink1

symlink2





In reply to Jeff White

Re: Symbolic Links within File System Repository

by Adrian Perez Rodriguez -

Hello Mr. White,

have you found in the end a solution for this problem? I've see an older topic where is a description how to add symbolic links as repository. https://moodle.org/mod/forum/discuss.php?d=223688#p1390859

But I think that this isn't working with the newer moodle version? Have you found another solution in the end?


Greets
Adrian

Average of ratings: Useful (1)