Debian 7 NGINX OwnCloud – move data-folder to NFS-mount permission problems?

Case:
Debian 7.1.0 server running nginx 1.2.1, hosting OwnCloud 5.0.13
OwnCloud default installed in /var/www/owncloud
Files uploaded to owncloud reside in /var/www/owncloud/data
However, diskspace is running low.

Idea is to move data to a file server which has more space, but I have a permissions problem.

File server in question is based on OmniOS (illumos derivate) managed by napp-it, ZFS filesystem with NFS exports.
NFS exports from OmniOS server are mountable and writeable, however I am not sure how to proceed as owncloud requires (afaik):
../owncloud/data to be 0770 and owned by www-data:www-data

I did try to move the /var/www/owncloud/data to data.old, symlink the nfs mount to ./data inside owncloud, owncloud refused to work, stating folder should be 0770 rights.
nginx instance is using www-data user and group.

On debian systems, UID/GID of www-data is 33, but this is reserved in OmniOS (atleast on my system I am not sure how to create www-data with uid 33 and group www-data with gid 33)

What would be a reasonable approach to have the debian server mount an nfs share from omnios with 0770 rights and www-data as owner as I am not sure if changing /etc/passwd uid and /etc/group gid of www-data is best practise to match on both systems (or would solve my permissions-problems)?

Answer

Debian Squeeze and Wheezy

in /etc/idmapd.conf – added Domain = mydomain-name
in /etc/default/nfs-common – added NEED_IDMAPD=yes (previously had =YES, doesn’t “work”)

Omnios

in /etc/default/nfs settings are deprecated and need sharectl management
i added sharectl set -p nfsmapid_domain=mydomain-name nfs
verified by sharectl get nfs

Attribution
Source : Link , Question Author : user185212 , Answer Author : user185212

Leave a Comment