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

Status
Not open for further replies.

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Hey DrKK,

you have a really nice Guide here.. everything worked perfectly and was kinda easy. The Explanations in the Video are very good and i like the fact, that you want to teach a little bit and dont just give a "step by step" manual, without knowing whats goin on.
I Used the Video and read the thread.

But i have one question: I have configured a new ZFS Volume but created the Jail in my pluginjailfolder, where the rest of the jails are on my old Volume. Is it possible to link up folders from another vol to my jail with owncloud, so that the data will be stored there? And not in the jail and the Volume itself? I mean like plex does it.

Or is it possible to move the whole Jail? I dont want to create a new one and begin from the start :p

Greetings
royber

Thanks for the kind words.

I am having a bit of difficulty understanding the questions, but I'll attempt to answer what I think you're asking.

First of all, OwnCloud is much (MUCH!) more like DropBox than it is like Plex, in terms of file storage. Every place the OwnCloud client software is installed will "synchronize" a local copy of the OwnCloud repository in a mounted directory of your choosing. The one place you have OwnCloud SERVER installed will have the "master" copy installed on a mounted directory local to it. You *CAN* change the "data directory" on your owncloud server, but as far as I know, it must be on a locally mounted filesystem. So you *could* use the "add storage" functionality in the jails to add a dataset that is not local to the jailhouse, like you would with plex, and you would simply specify the path accordingly (assuming proper permissions etc). I am not sure which part of what I just said is your actual question, but I feel like that whatever you're asking is contained in a subset of what I just said.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
By the way, I make those videos completely unedited. I just feel like the "real" way things happen, complete with the mistakes and typos, is the best learning tool. I am glad you like the style.
 

gabeszphoto

Dabbler
Joined
Aug 30, 2014
Messages
14
UPDATE: I've updated this guide, and turned it into a pretty long video on YouTube which you can access at this link.

What is OwnCloud? In a nutshell: It is like DropBox, but self-hosted. If your main use case for DropBox is just to have your own, personal, storage in the cloud, then you might find OwnCloud to be a useful alternative. Or, maybe it's just epeen to have one. Either way, it's pretty sweet, and installing it is quite educational. You can always delete it later if you don't have a use case. This guide will take you 30-45 minutes to complete.


EDIT: Please see the comments below this post, especially this one. There are more ways to install OwnCloud, to say nothing of its web serving/database stack, than I can possibly count. And I use the word "definitive", in the title, as sort of a joke on this fact.

There are a bunch of decent guides out there for installing OwnCloud. Unfortunately, I didn't like any of them, because they all seem to suffer from one or more of the following:
  • Just robotic, mystical, instructions, with no learning value. (If you want things to "just work", then buy a Macintoaster.)
  • Actual errors, or very sub-optimal choices for FreeNAS install scenarios.
  • A desire to proselytize for people's favorite stack permutations (we don't need forks of MySQL for a stupid OwnCloud guys, come on!).
But "whoa whoa whoa DrKK" you're saying. OwnCloud has a pbi plugin on FreeNAS. Why not just use that? Well, OK. It..."works". But it's not an ideal configuration, it's not an efficient configuration in some peoples' view (I don't know, I haven't tried it), it's not easy to upgrade, and it's certainly not very educational, and some people have had problems. It's really a crutch for people without enough skill and drive to do these things themselves, and accordingly, it's bad for the epeen.

I am offering below a process that I've wasted my whole weekend on honing for everyone to use, that should--thanks to about 20 iterations of me reworking it--take about 30 minutes to get your OwnCloud up and running on your FreeNAS (or, FreeBSD proper, subject to modification of the instructions). I'm going for the following:
  • Reasonably minimal memory and disk requirements.
  • We use a standard jail and the FreeNAS warden -- we will not be touching the FreeNAS appliance.
  • We'll use pre-built packages -- compiling from ports was...interesting. It is possible to do, but there are several gotcha's with some pretty esoteric things, like the event handlers, and I just figure you can't be bothered.
  • Light use case.
  • SSL-enabled, in case you want to open it up to the WAN.
  • You can use the WebGUI for OwnCloud, or the various DAV or dev clients, on files of any size, up to a few GB.
  • Just enough comments sprinkled through as to what's going on so that the process of installing it is at least mildly educational (that's why we're using FreeBSD, right?).
Assumptions:
  • You are familiar with Linux/UNIX-style basic commands and file system. i.e., I can say "go up to the parent directory and check the permissions on file x" and you know what I am saying.
  • I will use the IP address http://192.168.1.200/ to designate our OwnCloud jail. Yours will vary, of course, and you are to use the correct one, obviously, for your installation.
  • You will be creating a jail whose only purpose is to serve OwnCloud. Accordingly, the way I have you do this makes OwnCloud the "root" of your web server, so you will enter http://192.168.1.200/, and not http://192.168.1.200/owncloud/ (and, you will likewise suppress the 'owncloud' in any third-party WebDAV client that you use).
  • FreeNAS 9.2.0 or newer (if you are older than this, there will some things--like accessing the jail command line from the GUI--that you can't do, so you'll have to work around that).
Let's get started, shall we? Those using FreeBSD itself (and not FreeNAS) need not necessarily create any jail. Skip ahead as needed.

1. Create a Standard Jail
Go into the Jails dialogue to create a new jail. (If you have never created a jail before, you'll need to set your jail root and so on. See the FreeNAS docs.) Make sure you create a standard jail type, and uncheck the buttons for "vanilla", "vimage", and "NAT". You don't need any of that. Note the IPv4 address your jail is assigned. At the risk of ambiguity in this guide, I named my jail "owncloud".

2. Setup SSH.
Out of the box, the ssh and sshd config in new jails isn't convenient. We need ssh working well because we have some files to edit and what not. Even though this isn't strictly the "right way" to proceed, I just save myself a lot of trouble by ssh'ing into my main FreeNAS command line, and copying over the entire ssh config from that (which is set up the way I, and presumably you, like it) directly into the jail directory (from the FreeNAS appliance, you can get to any jail directories you want--just not vice versa). My jails root is in /mnt/ssd/jails/, and so my call looks like this:
Code:
[root@freenas] ~# cp /etc/ssh/* /mnt/ssd/jails/owncloud/etc/ssh/

In the above, the "owncloud" in the directory is the name of the jail from step 1.

Now, (assuming you're on at least FreeNAS 9.2.0, you can do this right in the GUI), access the command line of your owncloud jail, and perform the following steps:
  • type passwd to set up your root password in the jail.
  • type service sshd onerestart to actually enable the ssh service.
You're probably going to get a bunch of warnings about services_ssh. It's fine. This part is only for our convenience during install--we'll turn off ssh later.

3. Update pkg, and Get a Text Editor.
Now, log into your jail's IP with your ssh client (putty, whatever), and:
Code:
pkg update
pkg install nano

These two commands should not take very long at all. nano is your basic text editor. If you are newer than 9.2, then pkg update will probably ask you if you want to install it. Do so. It may ask you to type pkg2ng. Just go ahead and do that...if you don't need it, it won't hurt anything.

4. Update pkg.conf and Prepare to Get Software

This is not strictly necessary, the part I mark below as OPTIONAL. Some people with 9.2.1.3 had problems when they did the optional part. So don't do it unless you turn out to need it:

(((BEGIN OPTIONAL)))

Edit your pkg.conf file by typing:
Code:
nano /usr/local/etc/pkg.conf
and changing it to these three lines, which will be very similar to what's already in there (you'll be stripping off the reference to FreeNAS, for example):
Code:
PACKAGESITE: http://pkg.cdn.pcbsd.org/9.1-RELEASE/amd64
PUBKEY: /usr/local/etc/pkg-pubkey.cert
PKG_CACHEDIR: /usr/local/tmp

You may have some other lines (MIRROR for example). Just delete those. You only need these three lines.

Having done this, let's bring ourselves up-to-date with this repository by again typing
Code:
pkg update

(((END OPTIONAL)))
and then typing
Code:
pkg upgrade

This should update the pkg software itself. Type the exact same thing, a second time!
Code:
pkg upgrade

This may now update several built-in packages. In my case, 14 software packages were brought current--for some people on 9.2.1.3, nothing happened. If you type it again a third time, you should see no new updates. Good!

5. Time to Get OwnCloud!
We're now going to get the OwnCloud code, and the dependencies it requires in the pkg's repository. This will download about 50 things, and my research indicates that many of these are not strictly necessary---but who cares.
Code:
pkg install owncloud

It might take a minute or two to fetch and install everything.

EDIT: Please see the additional posts below this one. As of this writing, we've discovered that we're getting OwnCloud scripts that are about 6 months old. It is better to get the latest versions. There are instructions below referring you to Joshua's OwnCloud guide (elsewhere in this forum), and other pointers that you'll want. YOU MAY NOT WANT TO OBEY THIS STEP AS WRITTEN!

6. Get Lightweight Web Server
This is where we sort of get into personal taste. OwnCloud, at its most fundamental level, is nothing but instructions for a web server to serve content (in this regard, it is similar to the GUI in FreeNAS). Accordingly, it needs a web server to be installed to communicate with. OwnCloud "comes with" apache in the repository for this purpose (and that's what you get with the FreeNAS pbi if you use it). But, one can argue, this is a lot like using an M242 to shoot squirrels, or using a school bus to drive to work. It's a bit heavy. Your FreeNAS Web GUI uses something lighter, called nginx for this purpose--famously, it is said (paraphrasing) that "while apache does 1000 different things, nginx only does, say, 5--and it does 4 of those fifty times faster than apache". I'm going to suggest we go even lighter still, and use what's called lighttpd, i.e., "lighty". lighttpd is pretty bad ass, even though it is quite simple, and, for example, serves wikimedia and YouTube pages (or at least did---not sure if it still does).
Code:
pkg install lighttpd

and might as well do this to clean up:
Code:
pkg autoremove
.

Congratulations--at this point, you have all the software in your jail that you'll need. Now, we're down to configuration. Which, alas, is a bit of a pain in the ass. By the way, your jail is probably about 600MB in size now, and we're done downloading software. That isn't bad.

OK, let's do it. This is where I assume you understand basic navigation in a Linux/UNIX environment.

7. Basic lighttpd Configuration
Begin editing the webserver configuration file:
Code:
nano /usr/local/etc/lighttpd/lighttpd.conf

and make, and save, the following changes:
  • Change the server root, by locating the server.document-root line, and setting it to
    Code:
    server.document-root = "/usr/local/www/owncloud/"
  • (IMPORTANT) The compiled pkg of lighttpd was compiled without IPv6 support (odd--especially since IPv6 support is the lighttpd config default), (EDIT: now that I've thought about it some more, I don't know if maybe it's the fact that I didn't configure IPv6 in the jail or the FreeNAS? Either way, this hasn't been a problem in the past when I've installed other webservers, so I don't actually know what the issue is with IPv6 for my install---just take it out to be safe) so you will/may have to take it out. Locate the line that says server.use-ipv6 = "enable" and "comment it out", by placing a "#" in front, like so:
    Code:
    #server.use-ipv6 = "enable"
  • Also, comment out the line (probably the last line in the file) that sets up an IPv4 listening socket on port 80, again, by placing the hash "#" mark:
    Code:
    # IPv4 listening socket
    # $SERVER["socket"] == "0.0.0.0:80" { }
    This one took me quite a while to track down--it turns out for reasons that I don't particularly understand, lighttpd will open this socket ANYWAY, so if you specifically ask for it to be opened, you will get a "0.0.0.0:80 could not open socket, socket already opened" (or something like that) error.
  • Also, you may (optional) want to lower the settings for server.max-fds and/or server.max-connections. I use 256 and 128, respectively. You could go lower. But the defaults are much, much, much, much too high for this use case.
  • (Pro Tip) Don't worry about it if you mess up the configuration file beyond all repair. You will find the unmolested version of the file as lighttpd.conf.sample in the directory, and you can just delete the messed up file, and copy this file over and start anew. Similarly for most other config files we'll be messing with.
8. (Optional) Give It a Test

Code:
service lighttpd onerestart
should start the webserver without any errors if you did step 7 correctly. Now, go to your web browser, and go to the IP of your jail. If everything is working, you will get a 403-forbidden message. Don't panic, that's a sign everything is actually WORKING. There's more to configure. (The problem is that OwnCloud just served up a .php file, and you haven't configured anything to handle PHP--so the fact that you see the error means, ironically, that everything is "working" as much as it can at this point. Excellent!)

9. Set up FastCGI/PHP in lighttpd

We must activate the FastCGI module.
Code:
nano /usr/local/etc/lighttpd/modules.conf
find this line:
#include "conf.d/fastcgi.conf"
and "uncomment" it by removing the "#" at the beginning. Then, edit the fastcgi.conf file itself:
Code:
nano /usr/local/etc/lighttpd/conf.d/fastcgi.conf
and add your own fastcgi.server block (leave all the commented-out examples in there...):
Code:
fastcgi.server = ( ".php" => ((
                    "bin-path" => "/usr/local/bin/php-cgi",
                    "socket" => "/tmp/php.socket",
                    "max-procs" => 1,
                    "bin-environment" => (
                      "PHP_FCGI_CHILDREN" => "3",
                      "PHP_FCGI_MAX_REQUESTS" => "1000"
                    ),
                    "bin-copy-environment" => (
                      "PATH", "SHELL", "USER"
                    ),
                    "broken-scriptfilename" => "enable"
                )))

This sets up a bunch of PHP listeners for the web server, but far, far fewer than would be used in a publicly-available web page that would be accessed by tons of people. This keeps the resources required fairly modest.

10. Set up PHP itself

PHP is tremendously complex and annoying to set up. Don't even try to Google it. Two "sample configurations", both of which are insanely more complex than we need, are in the /usr/local/etc/ directory, namely php.ini-development and php.ini-production. Your PHP configuration depends upon what's in the file php.ini. Which doesn't exist. Yet. So, make a new file by editing it in nano:
Code:
nano /usr/local/etc/php.ini

and simply have it contain the following five lines:
Code:
post_max_size = 2000M
upload_max_filesize = 1999M
upload_tmp_dir = /tmp
cgi.fix_pathinfo = 1
memory_limit = 32M


You might be wondering, "what the hell's with the 1999MB limit on the file size" etc? Great question. And one that I lost some sleep over. Turns out there's a "bug" or something in PHP, where you're not going to be able to use anything over 2GB. After discovering this, and tracking it down, it seems like this git commit will fix this in future versions, but as of right now (March 2014), the PHP that pkg installed for me still had the bug. If you try to use a bigger file size, you'll receive an error, every time you upload ANY file, about the "file size" being "too big for the HTML max filesize specified in the HTML command" or something ridiculous like that. Of course, this is only for the WebGUI/PHP. If you upload to your "cloud" using the OwnCloud client you won't have any such limitations.

11. Test Your OwnCloud!

Let's give it a try!
Code:
service lighttpd onerestart

If it's working, it should have started quickly and without any warnings, and when you type "top" at the command line, you should see a single lighttpd and a few php-cgi processes owned by the www user:
Code:
last pid: 49189;  load averages:  0.33,  0.32,  0.29
13 processes:  1 running, 12 sleeping
CPU:  0.0% user,  0.2% nice,  0.4% system,  0.0% interrupt, 99.4% idle
Mem: 16M Active, 811M Inact, 14G Wired, 4564K Cache, 465M Buf, 589M Free
ARC: 10G Total, 4683M MFU, 4383M MRU, 290K Anon, 207M Header, 1170M Other
Swap: 8192M Total, 8192M Free

  PID USERNAME    THR PRI NICE  SIZE    RES STATE  C  TIME  WCPU COMMAND
45369 www          1  23    0  132M 19080K accept  0  0:03  2.20% php-cgi
45145 root          1  20    0 69588K  5224K select  0  0:02  0.00% sshd
45367 www          1  20    0 33168K  4532K kqread  1  0:01  0.00% lighttpd
44319 root          1  52  10 18636K  2180K wait    1  0:01  0.00% sh
45148 root          1  20    0 17568K  2964K pause  1  0:00  0.00% csh
44467 root          1  20    0 14180K  1596K nanslp  1  0:00  0.00% cron
44293 root          1  20    0 12080K  1576K select  0  0:00  0.00% syslogd
45368 www          1  52    0  128M 11052K wait    0  0:00  0.00% php-cgi
49189 root          1  20    0 16600K  2408K CPU1    1  0:00  0.00% top
49187 root          1  52  10  3816K  1488K nanslp  1  0:00  0.00% sleep
46557 root          1  52    0 46888K  4524K select  0  0:00  0.00% sshd
45370 www          1  52    0  128M 11000K accept  1  0:00  0.00% php-cgi
45371 www          1  52    0  128M 11000K accept  1  0:00  0.00% php-cgi


Awesome, now when you go to your IP address in your web browser, you ought to be greeted by the OwnCloud first-time start up page! Everything is ready to go! One you get it set up, try to drag in a medium sized file (say, 25MB? something like that), and make sure it uploads correctly.

If you want https (SSL) installed, keep reading. If not, skip to Step 14! Congratulations.

12. Create SSL certificate

This is for encryption, and not necessarily authentication. i.e., if you're at Starbucks, and want to get back to your OwnCloud and not have your password typed in the clear or have your OwnCloud data snoopable on the wire, this is what you want.

Make a certificate directory. I chose /usr/local/etc/lighttpd/certs but you can choose whatever you like. Just remember what it is. Navigate to the directory and create your certificate:
Code:
openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 1000 -nodes

Enter the information requested (you can lie if you want, doesn't matter), and then
Code:
chmod 400 lighttpd.pem
.

13. Instantiate an HTTPS Socket in lighttpd

At the bottom of /usr/local/etc/lighttpd/lighttpd.conf, add the following block:
Code:
# https socket
$SERVER["socket"] == ":443" {
  ssl.engine = "enable"
  ssl.pemfile = "/usr/local/etc/lighttpd/certs/lighttpd.pem"
}
where the directory and filename listed is the one you used from step #12.

14. Final Check

Restart everything with
Code:
service lighttpd onerestart


Check the following to your satisfaction:
  • http connection.
  • https connection (if installed).
  • test the upload of a small file in the web browser.
  • test the upload of a larger file in the web browser.
  • verify that any OwnCloud clients you will be using (in practice, people upload and download with the sync'ing owncloud client that they download, similar to how DropBox is done) are working correctly with respect to uploading, downloading, and what not.
  • Everything should be fairly snappy with this configuration.
15. Making it Permanent
  • Make your web server (and hence, OwnCloud) start automatically with the jail by adding it to the sysrc:
    Code:
    sysrc lighttpd_enable=yes
  • Disable ssh until such time as you need it again--this was not a very good/secure set up for ssh. Exit your ssh client, go back to the FreeNAS GUI, bring up your jail's command line, and disable ssh services:
    Code:
    sysrc sshd_enable=no
    and
    Code:
    service sshd onestop
That's it! Try stopping and restarting the jail, and making sure everything is cool! I hope that was useful. I donated an entire weekend to making this process and post :)

Hello DrKK!
Yesterday, I made the ownCloud configuration based on your tutorial video from Youtube. I config the HTTPS too. But, I use no-ip.org DDNS support to reach my FreeNAS OS, Transmission, etc.. and I would like to reach the ownCloud via this DDNS to. I defined a portforwarding in my Router and it works I get the ownCloud start page with the Error Message: This is an Untrusted Domain. I googled for it, and I made some configuration in the config.php file. I added the "(myddns).no-ip.org" and the "(myddns).no-ip.org:8998" (I defined this 8998 port for owncloud). I restarted the jail and the "lighttpd" service, but when I tried to reach again from my iPad via LTE connection my ownCloud I get the same "Untrusted Domain" error message.
Could you please help me? I attached the config.php file..
Thank you! Best Regards, Gabor
 

Attachments

  • config.php.txt
    485 bytes · Views: 355
Last edited:

Nethead

Cadet
Joined
Nov 1, 2014
Messages
1
Thanks for the wonderful how-to. Got it up and running on a fresh FreeBSD 10.0 and Opencloud 7.0.2. Your instructions still hold. IPv6 works fine but get a warning when kicking the webserver.

2014-11-01 23:18:06: (network.c.283) warning: please use server.use-ipv6 only for hostnames, not without server.bind / empty address; your config will break if the kernel default for IPV6_V6ONLY changes

Seems mostly informational in case I decide to recompile the kernel for IPv6 only... not a real world issue this decade.

You really did a great write up of the install that has passed the test of time. It only took me about an hour to install and get running FreeBSD and Opencloud with your guide. And I haven't really played with FreeBSD since about 6.0. Good on you!
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Interesting, good to know.

You're saying, you followed the guide for FreeBSD 10 (*not* a FreeNAS), and it worked well? I suspected that might be the case and am glad to have confirmation.
 

yonkoc

Explorer
Joined
Oct 26, 2011
Messages
52
Hello,

and thanks to all for the exhaustive information, to DrKK for the excellent video tutorial, to Cyberjock for keeping us on the straight and narrow :) and to everyone else here at the FreeNAS forums. You guys rock! I am more of the read a ton, try, fail, try, fail, ask, try, succeed type person. And...

...I am "newbie" when it comes to linux so please don't bash my head into the wall for obvious mistakes (I do that myself on my own time :). Here's what I have built so far and what my end goal is:
1. X10SL7-F along with a Xeon E3-1230v3 and 32GB of the "proper" RAM ECC :) Yes, I read the post about the RAM Crucial/Micron thing. It is on the recommended list.
2. FreeNAS 9.2.1.8 Release and a 4GB flash drive (will be upgrading to proper one very soon with 16gb each, just in case). No production data right now.
3. 11 x 2TB WD in a encrypted RAIDZ3. I had a FreeNAS 3 years ago and used it but a lot of things happened since so I essentially abandoned it. Wife, kid, house reno etc. I need a 72hour day for it all. So I had the 2TB drives ready. Would have gone with 4TB if I was building it now. A rack in the basement is coming along with some really high CFM fans for the HDDs. But for now it's "humming" along next to me and I'm warming my feet :)

My goal is to:
1. Use FreeNAS as repository for movies, pictures, music, backups, clients backups, images and anything that can go into cold storage. Long-term goal, use Mac Server for email and FreeNAS for storage of those emails but that's waaaaaay in the future.
2. OwnCloud as repository for documents, calendars and contacts synchronization and also for movie enjoyment while on the go. This means available on the internet.
3. Play media using OpenElec XBMC on RaspberryPi (already set up and tested successfully 1080p playback).
4. Stream movies and music on the go.

So far I've accomplished:
1. Actually building it and installing FreeNAS.
2. Setting up FTP, SSH (will do SFTP pretty soon) - tested connectivity on LAN. No outside attempts.
3. Attempted a few OwnCloud installs but each time I stopped and deleted the install as I was reading and watching DrKK's recommendations/tutorial and questions arose.

So here are my questions and I thank everyone in advance for their answers/suggestions.
1. With the potential of having millions upon millions of files (client backups) would it be wise to move from sqlite to MySQL for OwnCloud? And if yes, how? Please assume I need guidance like: ssh into your jail and type this....
2. With the potential risk of data breach, snooping etc, can/should I move to apache vs lighttpd? I would answer yes to that but then again, I have not a sliver of the knowledge of the big names around here. If yes, how? And per DrKK, why would also help. I need to know the "why" so I can understand the "how"?
3. Taking into consideration client machine synchronization and the gargantuan size of the media (movies predominantly) folder, which would be in the 5-6TB as a start, I cannot possibly sync this to a laptop. Is there a method that would serve like Dropbox's selective sync folder option. In other words I'd have a folder that has all the media into subfolders and possibly a subfolder I'd move stuff into for OwnCloud to see/sync? Is that the best recommendation.
4. How should I approach this from OwnCloud's perspective. I'd like to have access to the documents, calendars, contacts, etc at all times LAN and WAN side. as well as the movies/music folders for playback. Btw, movies are MKV format. Is there an app within OwnCloud that would do MKV? What are best recommendations security wise, I'd appreciate links and explanations please.
5. How would I connect the data repository on FreeNAS with the data repository within OwnCloud. I would most likely backup the data in OwnCloud (documents, cals, contacts) to FreeNAS. I probably do not need access to OwnCloud from FreeNAS (would be nice, not sure if secure) but I do need OwnCloud to have access to FreeNAS data folder.
6. SSL certificates. I am open to purchasing a certificate (need one anyway) or using a free one for home use from... errm forgot their name. I'll find them. Does each jail require its own certificate, or can I install one on the FreeNAS box and use the same. And how? Have not had to deal with certs yet so I could be asking something either blatantly obvious or something completely idiotic. Forgive me.

I am sure my head will explode with so many questions but I dare not commit this with production data until extensive testing of its functionality and security is performed.

Thank you all!

Respectfully,

Yo
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Let me take some of your questions:

1) Owncloud is not backup. I do not recommend you use Owncloud as a backup solution. Owncloud is specifically for files you want synchronized between computers.
2) I would not categorize apache as a lesser attack surface than lighttpd. In fact, because of its ubiquity out there, one could argue apache presents the riskiest attack surface.
3) Why do you need owncloud at all for this? Why does it have to be sync'd at all? This is what "Sharing" in FreeNAS is for.

Actually, the more I read your questions, the more I think you don't understand what Owncloud is, or what FreeNAS does. Most of the stuff you seem to be looking for is what FreeNAS *ALREADY* does. If you want a repository for files that you access, that's what FreeNAS is. You simply "share" out the directories (CIFS, for example, is the method for windows), and they will appear as if they were "disks" on your windows box. That's it. You don't need Owncloud for that. FreeNAS itself does that. Look at "setting up a share" in the documentation.
 

yonkoc

Explorer
Joined
Oct 26, 2011
Messages
52
Thanks DrKK,

1. Apologies, this is me being tired and confused in my own questions. Here I meant sqlite and MySQL in relation to OwnCloud data (docs) and FreeNAS data (backup files). Example. I would keep about 10GB of docs on OwnCloud that would be available via client sync to all remote points (phones, laptops, desktops in other parts of the world (family, etc)). But I would like to have the ability for OwnCloud to be able to have access to the millions of files that would be stored in the FreeNAS cold storage backup. Example: I work on a client machine and create a backup of it in FreeNAS data storage. Later on, a file is not restored to said client machine and I'd want to quickly share that file from the backup with said client. I might be on a trip or something and need to just get on my phone and quickly, via OwnCloud, find and share that file. With the millions of files on FreeNAS data storage and, possibly, the ability of OwnCloud to provide sharing with specific users, would OwnCloud need to have MySQL vs sqlite database to accommodate and handle those millions of files? I thought OwnCloud would be much better suited for that purpose than sharing a folder on FreeNAS and explaining to my client how to connect to it. I am worried about speed in searching files remotely via the app for example.
2. Understood, that actually makes a lot of sense. Make yourself as small a target as possible.
3. This would mostly be for watching pics, movies while on the go. Would OwnCloud with its built-in players do that or would I be better off with shares from FreeNAS? Example: iPad, OwnCloud, tap on folder, tap on movie/picture/music file and watch/listen using built-in player.

As far as your comment. I not always work with tech savvy friends/family/colleagues so sending them to install OwnCloud and log in with a given user/pass and all they need is right there would be significantly better than trying to provide info on shares, mapping, etc. At least that's the way I see it.

Thank you for the reply. I off to get some shut eye. Been a long day for me and would be an even longer one tomorrow. Have a good night!
 

atrdriver

Dabbler
Joined
Nov 1, 2012
Messages
25
Thank you for the guide! Used the video and got ownCloud up and running in no time.

One thing that I am having a problem with however, and I'm a noob so please forgive my ignorance. I did the ssl certificate as shown in the guide, and it seemed to work just fine, as in no errors showed up. But when I go to my server ip address using https:// I still get an untrusted connection screen. Is this normal or have I done something wrong? I saw the post that said the common name had to be the IP of the jail, so I tried that too, making the common name 192.168.1.145, which is the ip I type to get to owncloud, and I still get the untrusted connection warning.

Thanks in advance.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Thank you for the guide! Used the video and got ownCloud up and running in no time.

One thing that I am having a problem with however, and I'm a noob so please forgive my ignorance. I did the ssl certificate as shown in the guide, and it seemed to work just fine, as in no errors showed up. But when I go to my server ip address using https:// I still get an untrusted connection screen. Is this normal or have I done something wrong? I saw the post that said the common name had to be the IP of the jail, so I tried that too, making the common name 192.168.1.145, which is the ip I type to get to owncloud, and I still get the untrusted connection warning.

Thanks in advance.
That is quite normal sir. Thanks for the kind words by the way.

You see what's happened, is that you have made a "self-signed" certificate, when you follow those instructions. Normally, Firefox expects that you are accessing secure sites with a security which has been approved by a known certificate authority. When you make your own, you're just Joe Blow, and your certificate is (obviously) not vetted by trusted organizations. Accordingly, since this is also what a malicious interloper might do, Firefox warns you.

In English, the warning means: "I cannot verify that the certificate you're using was made by anyone that this web browser trusts. If you know what you're doing, and the certificate is known to you to be acceptable, then everything is cool".

So you just click: "I understand the risks", then you "add the security exceptions" (permanently), and everything is fine.

Again, it's just Firefox warning you that the identity of the certificate authority (i.e., you) has not been properly investigated by a trusted company. Which, obviously, it has not. The certificate itself is tip-top, fine. Proceed. This is an expected result.
 

royber

Cadet
Joined
May 1, 2014
Messages
5
Hi Drkk,

I wanted to make the owncloud available for the internet.. so i did some configurations on the lighttpd.
After some research i added this to the main conf file:
# deny access to /data
$HTTP["url"] =~ "^/data/" {
url.access-deny = ("")
}

At first i tried "^/owncloud/data/" but this didnt work. I guess because we changed the server.documentroot to "www/owncloud/" ?

Now the data directory is safe and you cant get there anymore... but there a a lot of more files and directorys which are available in the owncloud directory which is the documentroot...
Normally you only want the index.php accessable right?
How do i achieve this goal? Any tips?

I thought about something like "you are only allowed to access files like index.php, index.html and nothing else in the doc root"

Greetings
royber
 
Joined
Dec 26, 2013
Messages
18
Thanks, DrKK. Your video and written guide got me up and running in no time (watched the video all the way through, then followed along on the command-prompt for the second viewing). I know enough to understand the basics of the settings and advice you gave, but it would have taken me hours or days to research and hack it all out by myself. Thank-you, thank-you, thank-you.
 

lneib

Dabbler
Joined
Nov 29, 2014
Messages
16
Thank you for this tutorial, it was great and I certainly learned a lot. I noticed that there was an upgrade to Owncloud this past week but my install does not show me there there is an upgrade available and I have read some horror stories about upgrading Owncloud through the GUI. Can someone please explain to this "noob" the best way to upgrade to the latest version of Ownclound on the server? I currently have version 7.02 and want to upgrade to version 7.03. Second my admin panel is very slow to come up but it does eventually come up. My box is internet facing and I do have an SSL certificate installed.
 

Finn

Cadet
Joined
Dec 25, 2013
Messages
5
Thanks so much love your video and you have a really nice Guide here.
I've just got one problem. Im up to step 11 where I'm testing it after configuring the PHP and get this message.
Can you Please Help
P.S. I believe I'm the youngest to configure owncloud this way as I'm only 13 so I'm not fluent in any code language.

Code:
2014-12-01 10:13:16: (configfile.c.957) source: /usr/local/etc/lighttpd/conf.d/c
gi.conf line: 20 pos: 39 parser failed somehow near here: .php                
2014-12-01 10:13:16: (configfile.c.957) source: /usr/local/etc/lighttpd/modules.
conf line: 173 pos: 1 parser failed somehow near here: (EOL)                  
2014-12-01 10:13:16: (configfile.c.957) source: /usr/local/etc/lighttpd/lighttpd
.conf line: 88 pos: 12 parser failed somehow near here: (EOL)                 
/usr/local/etc/rc.d/lighttpd: WARNING: failed to start lighttpd 
 

lneib

Dabbler
Joined
Nov 29, 2014
Messages
16
DRKK, I have one more question and I appreciate the help . My admin page is loading slow but I think it is because DNS is not resolving inside the Owncloud jail inside FreeNAS. DNS is working on the rest of the network including from within the FreeNAS "shell". As soon as I hop over to the Owncloud jail side it does not resolve DNS but will allow me to ping to a public IP address. I am running FreeNAS 9.2.1.8 with Owncloud 7.02, LightTPD as my webserver, and LiteSQL for my database. I was hoping you or someone else on this forum might have some solutions for me. I have seen a lot of posts about windows server having this issue but not FreeNAS server issues and I know this is a little bit of a different animal. Thanks in advance.
 

lneib

Dabbler
Joined
Nov 29, 2014
Messages
16
Solved my own issue, for those having this same problem, take a look at this post I found. It solved my problem. I built the machine on a different network (a sandbox network) then physically moved it into the main network. Once I updated the resolv.config file inside the jail with the correct nameserver information everything is working as expected.

https://bugs.freenas.org/issues/3758

DRKK, once again your video was excellent and thank you for doing this!
 
Last edited:

Pharfar

Dabbler
Joined
Jan 6, 2013
Messages
46
@Finn, did you forget a comma after the .py line?
Code:
.py"  => "/usr/local/bin/python",
?

@DrKK OwnCloud (I thought), wasnt really anything we needed here in my house. But just for fun, I followed your guide (and maybe learn something new). But now its up and working, and I'm impressed. Besides the fact, that you have focus on minimizing resources, I can see hreat potential in OwnCloud. No more need for plugging in an iPhone, and transferring 4000 pictures at once. Now I can just instruct wife + kids to use the OwnCloud app, and do the uploading on-the-fly.

Oh, did I mention: I love FreeNas :smile:
 

Finn

Cadet
Joined
Dec 25, 2013
Messages
5
Thank you so much @Pharfar. You are a real life saver. You were 100% Right.

I would also like to thank DrKK for this awesome guide and even better video.

Thanks so much again.
Finn
 

madmax

Explorer
Joined
Aug 31, 2012
Messages
64
@DrKK

How would you go about installing mysql server with your configuration?

I would like to install mysql in another jail and I have done it before. I am confident that I can get that part working. But I can't get owncloud configure screen to allow the context boxes to show up for SQL rather its only allowing SQLITE. It saids that the only thing allowed. I have actually installed mysql mariadb packages in the same jail to see if libs need to be installed for it recognize and open the option but owncloud still shows only sqllite.

How do I enable the sockets so I can input the information to my database which will be another jail?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
@DrKK

How would you go about installing mysql server with your configuration?

I would like to install mysql in another jail and I have done it before. I am confident that I can get that part working. But I can't get owncloud configure screen to allow the context boxes to show up for SQL rather its only allowing SQLITE. It saids that the only thing allowed. I have actually installed mysql mariadb packages in the same jail to see if libs need to be installed for it recognize and open the option but owncloud still shows only sqllite.

How do I enable the sockets so I can input the information to my database which will be another jail?
I am not expert on databases. There's a lot more I'd want to learn about messing with databases and stuff before i'd be comfortable advising you. I suggest some Google searching. I didn't have much troubling finding guides on getting mysql running with this particular stack...of course, I didn't try to actually implement them...
 
Status
Not open for further replies.
Top