What is the best way to access folders that are outside Nextcloud default data folder but are located on the same disk/server? Is there any other way or I have to use “external storages” plugin?
I’m getting this error in the Nextcloud log and red exclamation mark is shown when I want to add the new path:
Error PHP stat(): stat failed for /home/user/pictures/ at /srv/nextcloud/lib/private/Files/Storage/Local.php#143
I’ve double checked and the permissions are correct.
I’m using Nextcloud 17. Any ideas?
Also these are the warnings I see in the overview tab, anything to worry about?
* MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read [the documentation page about this](https://docs.nextcloud.com/server/17/go.php?to=admin-mysql-utf8mb4).
* The "X-Robots-Tag" HTTP header is not set to "none". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
* The "X-Download-Options" HTTP header is not set to "noopen". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
* The "X-Permitted-Cross-Domain-Policies" HTTP header is not set to "none". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
* The "X-XSS-Protection" HTTP header doesn't contain "1; mode=block". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
* The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the [security tips ↗](https://docs.nextcloud.com/server/17/go.php?to=admin-security).
* No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the [documentation](https://docs.nextcloud.com/server/17/go.php?to=admin-performance).
* This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them.
`imagick`
* The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the [W3C Recommendation ↗](https://www.w3.org/TR/referrer-policy/).```
You are right, I get permission denied. How do I give it access then? The folder I want to access is in the home directory of another user (different than webserver user).
you have to give the webserver user permission, e.g. putting him in the same group or something. But if there is a security issue, the webserver can possibly read the whole personal folder. It would be a better to mount this drive to a neutral path (like /mnt/pictures), /mnt is readable by everyone and for the /mnt/pictures you can define who owns it and who is in the group to access it. (a user can still access and use a symbolic link to it in his home folder).
What would be the best option when you consider that I am running Nextcloud on a remote Ubuntu VPS? And if you could provider exact command that would be great as I am not Linux guru.
So I mounted the folder using: sudo mount --bind /home/user/pictures /srv/nextcloud/data/user/files/pictures
and I see that it works when I look at the folder through SSH but the Nextcloud doesn’t see the files, it says that folder “pictures” has 0 KB. How do I force Nextcloud to see the files?
Also how do I get this mount to be applied on system boot?
I’ve tried adding it to /etc/fstab but it is not working properly, it seems I’m adding it incorrectly, can anyone tell what would be the exact line that needs to be added to /etc/fstab from the above example?
When I do the above it mounts whole filesystem in the /srv/nextcloud/data/user/files/pictures folder, this is what I see when I ls in that folder:
bin boot dev etc home initrd.img initrd.img.old install lib lib64 lost+found media mnt opt proc root run sbin snap srv sys tmp usr var vmlinuz vmlinuz.old
But why Nextcloud doesn’t see any files when I look through browser UI in the /srv/nextcloud/data/user/files/pictures folder?
Because you first have to make sure that the user under which your web server is running, e.g. “http”, is allowed to access these files and folders. Second you have to scan and import the file structure to the Nextcloud database by running ./occ files:scan [options] [--] [<user_id>...] .
Check file permissions ls -laF /srv/nextcloud/data/user/files/pictures and make sure they are readable by your apache/webserver.
The folder /srv/nextcloud/data/user/files/pictures itself needs to have executable permission. * Try chmod 0755 /srv/nextcloud/data/user/files/pictures
Thanks, I ran the occ command and Nextcloud finally displayed files. But whenever there is a change or new files are added in that folder through SSH or other apps, they are not reflected in Nextcloud web UI, how to fix that?
I get this error when trying to install inotify app: App "INotify file watcher" cannot be installed because the following dependencies are not fulfilled: The library inotify is not available.
I feel like I’m fighting with windmills here, isn’t sharing files supposed to be one of Nextcloud core functionalities? Why is this so difficult to configure and enable?
Nextcloud is a software which is installed on top of an exiting system not replacing a system. It relies on system components and if you’re not providing this components it couldn’t fulfill its job. So install the missing component and it should work