Using File Browser with multiple paths or directories
In a previous article we configured File Browser to access “/var/www/html“, this time we will modify that configuration so to allow us access to multiple directories.
As a first step, create a directory for File Browser to use as storage, I have created one in “home” by running “mkdir /home/filebrowser“.
Then change the “filebrowser.json” configuration file “root” to point to the new directory, as below;
Stop and start File Browser by running the commands below;
systemctl stop filebrowser.service systemctl start filebrowser.service
When you access File Browser you should now see the below;
You could create Folders or Files in the new location, but we want to access existing paths, such as “/var/www/html“, to do that we can create in the “filebrowser” directory a “symlink” to the directory we need access to.
We will utilize the “ln” command for creating a symbolic link to a specific directory. Adding the “-s” option indicates that a soft link will be created for the specified directory.
ln -s /var/www/html /home/filebrowser/html
To better understand the above command, see the below;
ln -s [Source_Directory_Path] [Symbolic_Link_Destination_Path]
Now refresh your File Browser and you should see below;
All going well, you should now be able to create other symlinks in the “filebrowser” directory and access all the files you need to.