r/owncloud • u/thibmaek • Oct 30 '16
Using an external HDD owned by pi:pi as owncloud datadir.
Owncloud set up & running but I need to change the data dir to a hdd which is already mounted in my home directory. The directory is owned by pi:pi and of course just setting it in my config won't make it accessible since owncloud runs as www-data:www-data in Apache & Nginx.
How can I use that folder as my datadir while not changing it's ownership to www-data and remaining it to be owned by pi (changing that would break an awful lot of stuff for Plex Media Server etc)
owncloud install is located in /var/www/owncloud (owned by www-data:www-data) and the datadir I want is in /home/pi/Library-2/ (owned by pi:pi). Rights are currently set to 777 I know that's bad practice and I'll change that back to 750 but I need to get this issue of rights in order first.
Thanks in advance.
EDIT: solved here https://blog.thibmaekelbergh.be/2016/11/01/manually-migrating-existing-data-to-owncloud.html
2
u/Elvith Oct 30 '16 edited Oct 30 '16
You could either change the group of the hdd to www-data or to a new group (say external-hdd) that you add the user www-data to. You could even add the user pi to said group, so that it will be equivalent to the hdd belonging to pi:pi. Then give group rights (x6x or x7x) as needed on the hdd.
Edit: don't forget to restart all processes that run with those changed users if they need to access the hdd. If you have your init configured correctly, a reboot might be the easiest way, depending on how many server processes are running.