Best Practices For Setting Up Storage In ownCloud Jail

Status
Not open for further replies.

alteredstate

Cadet
Joined
Jan 31, 2018
Messages
6
Hello everyone!

I just wanted to get some opinions on the storage setup in an ownCloud jail to prevent data loss as well efficiency? I personally created a ZFS dataset called ownCloud then used /mnt/zpool/ownCloud as my Source and /media/me/files as my Destination in the ownCloud jail storage. I then logged in ownCloud as Admin, clicked on External Storage, named the folder, set the path and assigned the user. However, this seems like it could get quite tedious and messy if creating several ownCloud users as well as maintaining separation of their data. It appears I would need to create a specific ZFS dataset for each user as well as mount that dataset appropriately in each user's corresponding directory and add the External Storage...that's why I thought I might be going about this wrong do to the amount of setup involved per user. Just FYI, I'm migrating from a Synology setup and really enjoy FreeNAS but there is a slight learning curve so I apologize if this question is elementary.
 

alteredstate

Cadet
Joined
Jan 31, 2018
Messages
6
Kind of but not sure if it's a good solution. I ended up creating the ZFS dataset: /mnt/zpool/ownCloud/me, setting that as the Source and then: /media/me/files as the Destination in the Jail storage. I then set that up as External Storage in ownCloud. Not sure if that will become cumbersome down the road but it's all I got right now. Thanks for the reply though!
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I don't quite understand what you are trying to do, but it sounds overly complicated!

If you install ownCloud in a jail you'll be creating something like /mnt/pool/jails/owncloud to store the jail. By default, the ownCloud files will reside in /mnt/pool/jails/owncloud/usr/local/www/owncloud with the data files being stored in a subdirectory of that /data. Each user you create will then create a further subdirectory based on their username so you end up with data stored at /mnt/pool/jails/owncloud/usr/local/www/owncloud/data/username

Lots of the guides recommend creating a separate dataset for storing the /data outside the jail structure and then pointing the ownCloud configuration to that, mine, for example, is /mnt/pool/ocfiles/username(s) and even doing the same for the database, again mine is /mnt/pool/ocdb. This makes backing up just the user data or database a little easier, but given I'm backing up the jails too I probably didn't need too :)

You don't need to create datasets or file structures for each users files - ownCloud will do that, and I don't think it will even work having different locations for each user outside it's /data folder. I think you're achieving this using external storage, but I don't understand why you would? I'd just let ownCloud do its thing, and all you really need to decide is whether to keep the data/base inside or outside the jail.




 

alteredstate

Cadet
Joined
Jan 31, 2018
Messages
6
I don't quite understand what you are trying to do, but it sounds overly complicated!

If you install ownCloud in a jail you'll be creating something like /mnt/pool/jails/owncloud to store the jail. By default, the ownCloud files will reside in /mnt/pool/jails/owncloud/usr/local/www/owncloud with the data files being stored in a subdirectory of that /data. Each user you create will then create a further subdirectory based on their username so you end up with data stored at /mnt/pool/jails/owncloud/usr/local/www/owncloud/data/username

Lots of the guides recommend creating a separate dataset for storing the /data outside the jail structure and then pointing the ownCloud configuration to that, mine, for example, is /mnt/pool/ocfiles/username(s) and even doing the same for the database, again mine is /mnt/pool/ocdb. This makes backing up just the user data or database a little easier, but given I'm backing up the jails too I probably didn't need too :)

You don't need to create datasets or file structures for each users files - ownCloud will do that, and I don't think it will even work having different locations for each user outside it's /data folder. I think you're achieving this using external storage, but I don't understand why you would? I'd just let ownCloud do its thing, and all you really need to decide is whether to keep the data/base inside or outside the jail.

Hello,

/mnt/zpool/jails/owncloud_1/usr/local/www/owncloud/data does not exist:
Terminal.png



even after I setup my username.






I did however see that my username (marcus) was created in:
Storage.png
However, after setting the Source and Destination as shown in the screenshot, I am no longer able to access my ownCloud, I simply get: "This Site Cannot Be Reached".

The only way I can get back to ownCloud is to reinstall it and set the Source and Destination as shown (before I create my username) but then I receive this error:
Initial Setup.png


Hence, why I'm confused too. I would totally set my ownCloud up how you did but I cannot even get to that point and I'm not sure what I'm doing wrong.
 

alteredstate

Cadet
Joined
Jan 31, 2018
Messages
6
The only way I can get back to ownCloud is to reinstall it and set the Source and Destination as shown (before I create my username) but then I receive this error: View attachment 22726

Changed permissions on: /mnt/zpool/ownCloud/usernames to: www:wheel (chown www:wheel /mnt/zpool/ownCloud/usernames) and I was able to create my username and password. I can also create a folder on the ownCloud main page. I think it's important to stress that Source and Destination storage MUST be setup before you create a username otherwise it will destroy the contents in the Destination directory rendering ownCloud unaccessible! I did not see that in any of the guides I read either.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
The name owncloud_1 suggests you're using a Plugin? Not sure how this configures everything, but the principles will be the same. A single /data directory that ownCloud uses for all user data and it will create the username folders as you add users in ownCloud.

I never liked the plugin as it uses SQLite for the database, which I found to be very slow when syncing data using the desktop clients, especially as the volume of data grows. There are several good guides how to set up ownCloud manually in a Jail that allows you to use mysql. I'd have a look at one of those.
 

alteredstate

Cadet
Joined
Jan 31, 2018
Messages
6
The name owncloud_1 suggests you're using a Plugin? Not sure how this configures everything, but the principles will be the same. A single /data directory that ownCloud uses for all user data and it will create the username folders as you add users in ownCloud.

I never liked the plugin as it uses SQLite for the database, which I found to be very slow when syncing data using the desktop clients, especially as the volume of data grows. There are several good guides how to set up ownCloud manually in a Jail that allows you to use mysql. I'd have a look at one of those.

Yeah, there's a statement under "Tips & tricks" in the ownCloud Admin section stating that I needed to switch databases because SQLite is being used. I found these two guides for installing ownCloud in a jail with a better database:
https://forums.freenas.org/index.ph...talling-owncloud-in-freenas-or-freebsd.19605/
&
https://forums.freenas.org/index.php?threads/how-to-owncloud-using-nginx-php-fpm-and-mysql.17786/

In my younger years I would have gladly taken on this task but as I get older I just want "turn key" solutions. Both those guides seem intense with all of the customizations...which also typically come with a lot of speed bumps and road blocks during the process. With that said, this seems less than appealing. It's disappointing the ownCloud plugin is not sufficient enough and how many of the other plugins are not sufficient enough either? I really hoped my migration from a Synology setup was going to be straight forward but that does not appear to be the case.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
There is a bit of a learning curve with FreeNAS, but take it slowly and in stages and I think it's worth the journey. I started off in a similar situation testing out the plugins then creating a few jails. I used the second of those to set up my ownCloud jail and it's been running perfectly ever since.
 

alteredstate

Cadet
Joined
Jan 31, 2018
Messages
6
There is a bit of a learning curve with FreeNAS, but take it slowly and in stages and I think it's worth the journey. I started off in a similar situation testing out the plugins then creating a few jails. I used the second of those to set up my ownCloud jail and it's been running perfectly ever since.

Will do! Thanks for the help!
 
Status
Not open for further replies.
Top