Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

DrKK's Definitive Guide to Installing OwnCloud in FreeNAS (or FreeBSD)

Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE
Status
Not open for further replies.

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
I just installed owncloud again using the video guide. I have done this install a couple times to test it out. I already have the plugin version installed and secured with SSL but I wanted a lighter install. When I installed with pkg, it installed v8.0.3, which isn't the latest version. So, I thought no big deal, ownCloud has it's own updater in the GUI. However, when I tried to run the updater app I get a message saying "Make sure that your web server has write access to the following files and directories:" and about a million files are listed. Has anyone ran into this when trying to use the Updater app in the GUI?
Yes I've seen this before.

Go to the appropriate directory, which I believe is /usr/local/www/owncloud
and just change, en masse, the owners of the whole thing:
Code:
chown -R www:www *


that should probably do it. It might leave a few laying around, which you can change manually:

Code:
 chown -R www:www file_in_question.dat


I've noticed that if you upgrade the owncloud pkg (either by portmaster from ports, or from pkg) itself, this is usually not a problem. When you try to do the upgrade inside of the owncloud GUI, you can run into this.
 

Bmck26

Member
Joined
Dec 9, 2013
Messages
44
Thanks, now I just have to get the SSL setup and I can get rid of the plugin.
 

Jonathan Rose

Neophyte
Joined
Feb 1, 2015
Messages
11
Just want to start out by saying thank you @DrKK for this guide. I agree that using the OC plugin for FreeNAS isn't for most people especially since it assumes WAY too much about the initial setup. Now for my question, I've been going through the OC admin guide as well as your instructions (as well as watching your video on YouTube) to sort out how to do the initial setup with an instance of MariaDB/MySQL. I have a SQL server running from another jail and installed the client on the same jail as OC (had to do a little tweaking to get the OC jail to recognize the resolve name for the SQL database host).

I followed the instructions and have it configured for SSL with security (no longer seeing the warning about the .htaccess file), but still can't seem to prompt for database configuration aside from SQLite. Any ideas?
 

Attachments

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Just want to start out by saying thank you @DrKK for this guide. I agree that using the OC plugin for FreeNAS isn't for most people especially since it assumes WAY too much about the initial setup. Now for my question, I've been going through the OC admin guide as well as your instructions (as well as watching your video on YouTube) to sort out how to do the initial setup with an instance of MariaDB/MySQL. I have a SQL server running from another jail and installed the client on the same jail as OC (had to do a little tweaking to get the OC jail to recognize the resolve name for the SQL database host).

I followed the instructions and have it configured for SSL with security (no longer seeing the warning about the .htaccess file), but still can't seem to prompt for database configuration aside from SQLite. Any ideas?
My attempts to successfully set up a MariaDB/MySQL in a jail and get connections from another jail to it have not been successful. If there's one place where I'm weak, it's SQL stuff. It's on my list of "leaks in my game" to shore up. @Joshua Parker Ruehlig probably is the sensei for that.

Also, overall, I'd consider that query to be more of an Owncloud or MySQL question than a FreeNAS question. You might want to check out the #owncloud irc channel, the OwnCloud forums, and/or deepen your dive on the Googles.
 

Jonathan Rose

Neophyte
Joined
Feb 1, 2015
Messages
11
Thank you for the feedback @DrKK, it is greatly appreciated. However, by muddling around Google, OC Documentation, and running a series of pkg search (as well as trial and error pkg install commands) I was able to figure out why I was not seeing the option to choose another database. But, as you said, getting a connection to an instance of SQL is another beast entirely. If you want to add this to your guide and/or YouTube video, the command I ran was thus:

pkg install phpXX-mysql # XX signifies the version of PHP installed when running pkg install owncloud (e.g. php56-mysql as of 6/14/15)

This allows php and OC to recognize SQL connections from MariaDB/MySQL in addition to SQLite. If I figure out how to get the connection to work, I will keep you posted so you can supplement your guide for those who wish to use databases that can handle larger (100GB+) instances.

Now, for the million dollar question. When you were attempting to connect an external database (regardless of where it was hosted within the jail, another jail, or another system altogether), were you getting resistance due to a "missing" driver? I've attached a screenshot for "clarification" (I'm of course using the word "clarification" loosely since the error is incredibly vague).

Cheers!
 

Attachments

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Now, for the million dollar question. When you were attempting to connect an external database (regardless of where it was hosted within the jail, another jail, or another system altogether), were you getting resistance due to a "missing" driver? I've attached a screenshot for "clarification" (I'm of course using the word "clarification" loosely since the error is incredibly vague).

Cheers!
No. I don't even completely understand SQL in the first place (it's never come up for me professionally), so I literally was floundering around typing [profanity] that I was directed to type from various forum posts, and stuff. It was a disaster. I have a lot to learn before I can even remotely assist you, or remember precisely what errors/problems I was having.
 

Jonathan Rose

Neophyte
Joined
Feb 1, 2015
Messages
11
Got a working install with SSL, external SQL database, LDAP integration, and using existing FreeNAS data sets. I'm going to document so I can reproduce should I ever need to do so in the future.
 

Azimech

Neophyte
Joined
Mar 25, 2015
Messages
6
Finally got around to working on this, and it seems to be working properly. I had to do the install from ports to get SQLite working (Which provided additional opportunity to learn how to use FreeBSD), but I think I'm good to go. As long as I followed the SSL directions in your post and set up lighttpd.conf the way it's stated on this page, I should be secure enough to open it up to the internet, yes?

Thanks again!
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
As long as I followed the SSL directions in your post and set up lighttpd.conf the way it's stated on this page, I should be secure enough to open it up to the internet, yes?
Well, no. Not necessarily.

All of this depends upon your own skillset, knowledge, and risk tolerance. Generally speaking, the members of this community do not recommend opening up FreeNAS, or OwnCloud, or anything else we might be running, to the wider Internet without a vigorously maintained VPN such as OpenVPN. Anything short of that, we would caution against.

But again, it depends on your risk tolerance and other factors. As a community, we are generally, on the continuum from "lax" to "fascist", more in the "fascist" camp when it comes to these kinds of considerations. None of us would recommend opening up a PHP-based thing like OwnCloud to the wider internet, unless it is done through something like OpenVPN. Your Owncloud is in a jail, which limits the attack surface, and if you took precautions such as selecting obscenely obscure ports to access the server, via HTTPS only, for example, that is far better than nothing at all.

It depends on you. *WE* would say "no, that's not secure enough, use a VPN, or get out of our face". But we are fascists on this issue.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
By the way, I am going to update the original post here with the fact that the FreeBSD port for owncloud no longer is configured by default for sqlite3.
 

Azimech

Neophyte
Joined
Mar 25, 2015
Messages
6
Duly noted. I already run a VPN to access the bulk of the things within my internal network, as well as whenever I'm using any sort of public internet connection. I only use cloud storage as a place to conveniently sync my KeePass databases across multiple devices, for example, when I'm on my work computer without VPN access. I take it that the "proper" way of doing things if I'm erring on the side of caution is doing the ownCloud stuff on some sort of offnet VPS?
 

INCSlayer

Member
Joined
Apr 4, 2015
Messages
193
small update i was following your video (its great) and i hit a snag that sqlite was not available i had to manually install php56-sqlite3 for it to work im guessing someone forgot a dependency somewhere?
By the way, I am going to update the original post here with the fact that the FreeBSD port for owncloud no longer is configured by default for sqlite3.
yea i noticed that when i was installing it yesterday manually installing php56-sqlite3 php56-pdo and php56-pdo-sqlite
solved that issue
 

Jonathan Rose

Neophyte
Joined
Feb 1, 2015
Messages
11
@INCSlayer why would you use SQLite for ownCloud? It's extremely limited in capacity. Unless you have a VERY small database requirement? Just curious what the thought process is here since I knew right off the bat to use MariaDB/MySQL to allow a decent sized instance.
 

Jonathan Rose

Neophyte
Joined
Feb 1, 2015
Messages
11
@DrKK Haven't had a chance to document my setup for OC with an external SQL database, but for the most part it was fairly straight forward. A quick Google search for "installed MariaDB on FreeNAS" filled in 99% of the work :)
 

INCSlayer

Member
Joined
Apr 4, 2015
Messages
193
@INCSlayer why would you use SQLite for ownCloud? It's extremely limited in capacity. Unless you have a VERY small database requirement? Just curious what the thought process is here since I knew right off the bat to use MariaDB/MySQL to allow a decent sized instance.
maybe just maybe because i dont need more power i am the only user and i only sync content between the server and 2 computers i dont need to run an extra database for that?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Well, perhaps it's easier than it used to be, or perhaps I'm stupider than I give myself credit for, but getting the MySQL databases set up in the jail had been very non-trivial for me. Perhaps I will look at the resources you suggest.

Also, there's not a thing in the world wrong with the sqlite-based Owncloud, for a user or two, except the the performance is mediocre. e.g., files might sync at 50-100Mbps max. If that's ok with someone, then, in principle, they can go with that.

Also, the MEMORY REQUIREMENTS are way different. When you put in a MySQL or MariaDB, you're blowing away tons of memory, permanently, to run that service. On a FreeNAS, that's something to think about, because that memory comes off your ARC.
 

norskman

Member
Joined
Sep 28, 2012
Messages
149
When I do a pkg upgrade owncloud I get v8.0.4 not the latest v8.1

why is this?

Surely the pkg repo should know that the V8.1 is out there.....

Can someone help me? I am trying to do a clean install using Dr. KK - this does work and work very well.....but I just can't seem to get the latest version V8.1.
 
Last edited:

INCSlayer

Member
Joined
Apr 4, 2015
Messages
193
well the repo only knows about V8.1 if whoever is in charge of it updates the pkg in the repo otherwise it wont know
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
well the repo only knows about V8.1 if whoever is in charge of it updates the pkg in the repo otherwise it wont know
Exactly. For things in the pkg/ports repo, each will have maintainer(s). It is the job of the maintainer (a volunteer) to update the pkg/port to reflect the most up-to-date version. This is sometimes easier said than done (e.g., "murmur", the Mumble server), but sometimes it ought to be pretty straightforward.

In any case, there is some lag between when version X of something comes out, and when the ports tree committers are satisfied that they are ready to deploy version X in the repo.

Just sit tight, sir.
 
Status
Not open for further replies.
Top