Apologies in advance as Iām new to nextCloud and may not use proper terminology, etc. Similarly, please let me know if I can provide additional information.
Iām Attempting to install nextcloud on a Ubuntu apache web server, and then point the data directory to shared network location stored on a Synology NAS shared folder. Iāve followed instruction of installation guide for occ line installation. The installation states that it was successful in the terminal. However, when I navigate to http://localhost/nextcloud, I receive the following error message "
Error
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.
"
Iāve tried following the instructions found here, but neither of the solutions have resolved the issue.
Does anyone have any suggestions for what the problem might be and how I can resolve it? Iām at a loss of where investigate/troubleshoot.
The /etc/fstab entry for the NAS shared folder is below:
IPADDRESS:/volume1/nextCloudData /media/ncShare/ ntfs-3g quiet,defaults,permissions,locale=en_US.utf8
What Iām attempting to do is mount the /volume1/nextCloudData folder in the NAS and mount to local folder /media/ncShare.
If this isnāt what you requested, please elaborate.
There is some definite strangeness happening to this. I rebooted and was periodically given an error that the nfs was no longer accessible on reboot. After repeated attempts I was able to remount in terminal only (fstab was no longer working) using the following command:
mount -t nfs IPADDRESS:/volume1/nextCloudData /media/ncShare/
However, the error I receive when loading localhost/nextcloud has changed to below:
Internal Server Error
"
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
"
Iāve tried restarting the machine, and running the commands as you have above. When I try to load nextcloud, I now receive the following error:
Internal Server Error
"
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
"
Opening up the nextcloud.log, I see an entry of:
{āreqIdā:āI4sMD8yNOUnIzAFcJhwlā,ālevelā:3,ātimeā:ā2018-09-03T16:49:34+00:00ā,āremoteAddrā:ā127.0.0.1ā,āuserā:āāā,āappā:āPHPā,āmethodā:āGETā,āurlā:ā/nextcloud/index.phpā,āmessageā:āchmod(): Operation not permitted at /var/www/html/nextcloud/lib/private/legacy/util.php#1007ā,āuserAgentā:āMozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0ā,āversionā:ā13.0.5.2ā}
after doing the ```
sudo chown -R yourname:www-data /media/ncShare
sudo chmod -R g+s /media/ncShare
commands the error message changes on page load,
"
Error
Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/13/go.php?to=admin-dir_permissions.
"
Terminal RESULT:
Nextcloud is not installed - only a limited number of commands are available
Canāt create or write into the data directory /media/ncShare/
Is it possible that this is something to be setup on the NAS side? Or is the fact that it mounts mean that everything is working properly on that end?
I have confirmed that at least part of the issue is/was on the synology NAS side. I have successfully mitigated the ācanāt create or rwite into the data dictionaryā error I was receiving by changing NFS permissions on the folder in disk station by going to Control Panel > Shared Folder>nextCloudData (shared folder). Click Edit, NFS Permissions, Create permission where SQUASH: = āMap All users to rootā.
After doing this, Iām able to install nextcloud successfully.
However, when loading in the web browser, I again receive the
Error
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.
Does anyone know how to set this permission for the nextCloudData folder in Disk Station or through ssh to set the 0770 permission for admin?
I am sorry I cannot be of any more help Just a thought, on Thecus you can ssh the machine, then these shared folders are normally mounted under /volumeX/ with the same name you set up in the gui. Most Linux based NAS systems has the limited functionalities like chmod and chown built in. You can do it this way if you want.
NP. Iāve identified the cause but do not have a solution or full understanding of why. A bit of context for others who may happen to have the same problem in the future. I have found a way to test the problem.
SSH/Putty, I run chown and chmod for the guest:users (user:group) on the NAS system. Next in Synology disk station edit Shared FOlderās permissions with the following:
Set NFS Permission Squash = āMap all users to guestā
Set Permissions for Guest user = Custom (checking all administration, read and write check boxes and applying to all folders)
Set permissions for users Group = Read/Write.
When I do this the application works perfectlyā¦for a single sign into nextcloud. For some reason, the permissions on this folder are changed(either by nextcloud or by synology) on logout. Specifically, the āDeleteā permission under Write is removed(unchecked) for users group and the Administration check boxes are all removed(unchecked) for the Guest user. If I re-check these, I get another logonās worth of functionality.
Do you or anyone else know if this is likely Nextcloud or Synology changing the permissions? If the latter, it may mmake more sense for me to post on the Synology forumsā¦
I personally feel this is something synology does. Easy way to test, is to install Nextcloud to a local folder setting the same permissions. If the same happens, it is Nextcloud and we have to troubleshoot some more, but if it works, it must be your DS.
I have confirmed that it is something with either the permissions in Synology NAS or the way the nfs is being mounted. Will continue to investigate and update this thread with result. Thanks again.
I was thinking performance and security might be better if having a web server in front of the NAS, which would hold the raw data. IDK if you have thoughts about that one way or the other.
Regarding security, I have a friend who hosts a web server directly on his Synology. The Apps/Bundles/whatever-it-is called is well written for DS. I ran Nextcloud on my Thecus for a while, but stopped (for various reasons), mainly due to the little RAM I had in there. So performance wise most of these things like Nextcloud is very lightweight, especially if there is a pre-built app that you can just āenableā. Is this the case with Synology? Or do you physically have to install all the components? Thecus was just an app you enabled, and it installed mysql and php as dependencies by itself. Security wise, whether you have it running directly on the NAS or have something in front of it, if the overall security sucks, it wonāt matter. If you mount the drive to DS and something goes bad, data is still gone. So having proper overall security would rather be the thing to look at here.