FreeBSD上に入れたOwnCloud 8.2がWebDAV周りでエラーが出る件、多分解決!!

いろいろググっていたところMy ReadyNAS Blog: Overview of ReadyNAS Permissionsという文書に突き当たり、次のような記述を発見。

A note about HTTP/HTTPS access

When connecting via CIFS to a share as the user 'admin', (or AFP if you are leveraging this tip) the previously mentioned permissions are pretty much ignored and the user has full read/write access to all files. This is because despite connecting as the user 'admin', data is actually manipulated as the user 'root' which is a specially privileged user on Unix/Linux based systems. The admin user is however a member of the group 'admin' and so care should be taken when modifying or creating files & folders while connected as the admin user: such files will be owned by 'root', assigned to the group 'admin', and therefore standard users cannot access such files unless the everyone permissions are set.

Unfortunately this adds a complication: ReadyNAS devices actually run applications as the admin user - notably the Apache webserver that provides HTTP, HTTPS & WebDAV access to shares. When accessing files via HTTP, HTTPS, and/or WebDAV, irrespective of which account is used to login to the ReadyNAS, all files are accessed on the as the user 'admin'. Note we are referring here to the real admin user account of the underlying Linux OS, not the superuser (root) that is used when logging into a ReadyNAS device via CIFS or AFP as the admin user (Yeah - it's like the admin account is schizophrenic! One set of permissions when accessing the ReadyNAS via HTTP, another when accessing via CIFS or AFP).

This means that the webserver, running as admin can, by default, only access files that either:

  • are owned by admin
  • belong to the admin group
  • have everyone permissions set to Read Only or Read/Write

If permissions are not set appropriately for Everyone, then the admin account (as used by the webserver) can access neither standard user created files, nor those created by the guest user. This is also true if you connect via FTP as the user 'admin'.

Fortunately access by admin can be fixed in the main part by adding 'admin' as a member of the same group(s) to which users belong - typically "users" - in Frontview » Security » User & Group Accounts.

で共有設定を確認したところ所有者/グループともにadminになっていたので普段使っているユーザ権限に変更。

これで直ったっぽい…。今のところOwnCloudへのアップロードはちゃんと動いている。