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

Status
Not open for further replies.

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
The WebDAV error is gone. I don't use WebDAV AFAIK so I only did what I did to get rid of the error.

In any case, you get to the updater by logging in as an admin account and going to settings. Scroll down and click the updater button. Then click the updater tab.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
DOh.. yeah.. admin. :P My bad. Tired. Going to bed. I'll mess with it tomorrow.
 

James S

Explorer
Joined
Apr 14, 2014
Messages
91
I'm trying to configure windows (7 professional) to work for backup and read-write access for data stored on the NAS (9.2.1.5). I'm accessing the NAS from home over the internet. So far I've been using FTP to access the data and have the NAS as a mapped drive on the windows machine. When I tried to open files from the mapped drive in Microsoft Word or another program I get error messages (e.g., cannot write the file).

So a few naive questions to try and figure out a solution...

It seems if I want to do 'live' read-writes from programs to the NAS I need to configure webdav. Is this right? Is this part / all of the 'OwnCloud' package?
Currently I use FTP (as documented) so users chroot with a strong password. So I have data configured there. Can I set up webdav to 'point' at this prexisting file structure safely? (Bots crawl all over the machine all the time)
I am setting up rysnc for backup. So with webdav setup and SSH running should I shut the FTP? The documentation seems to infer multiple access methods are not recommended.

Thanks for any input!

Thanks too to cyberjock for his excellent -- if direct -- posts on avoiding vmware configurations.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
So a few naive questions to try and figure out a solution...

It seems if I want to do 'live' read-writes from programs to the NAS I need to configure webdav. Is this right? Is this part / all of the 'OwnCloud' package?
Currently I use FTP (as documented) so users chroot with a strong password. So I have data configured there. Can I set up webdav to 'point' at this prexisting file structure safely? (Bots crawl all over the machine all the time)
I am setting up rysnc for backup. So with webdav setup and SSH running should I shut the FTP? The documentation seems to infer multiple access methods are not recommended.

Thanks for any input!

Thanks too to cyberjock for his excellent -- if direct -- posts on avoiding vmware configurations.

OK, well, OwnCloud certainly uses WebDAV. That's all I can tell you. If Owncloud is configurable to make some sort of network live read-write mapped drive, well, sir, you're on your own. I have no idea.

The problem with FTP is your password is totally in the clear. Anyone sniffing your packets can see it. So it's not what I would suggest using from the internet side, without additional countermeasures (such as a VPN). If that's not your cup of tea, then configuring SFTP or similar service would be preferable.
 

James S

Explorer
Joined
Apr 14, 2014
Messages
91
OK, well, OwnCloud certainly uses WebDAV. That's all I can tell you. If Owncloud is configurable to make some sort of network live read-write mapped drive, well, sir, you're on your own. I have no idea.

There seems to be some movement on this issue in the forthcoming release?
https://bugs.freenas.org/versions/114
So with some luck I may not be entirely on my own!

The problem with FTP is your password is totally in the clear. Anyone sniffing your packets can see it. So it's not what I would suggest using from the internet side, without additional countermeasures (such as a VPN). If that's not your cup of tea, then configuring SFTP or similar service would be preferable.
Thanks for the input. I was worried about security and wanted to use SFTP but the program I was trying for backup (Acronis) does not support that. Since Acronis fails to function even with a basic setup on ftp it seems to have done me a favour to look for better (and more secure) solutions.
 

madik

Explorer
Joined
May 5, 2014
Messages
54
I have one noob question not directly related to this guide but i stuck here.

I've opened a putty session to an IP address of my Owncloud jail. Logged in with root and default password of my Freenas. The shell is starting with suspicious [root@Freenas] instead of [root@owncloud].
What Iam doing wrong? I cant do any of the pkg commands. Do I have to enter the jail with command (cant remember the command but I will look for it) ? But if so its pointless to logging on the Jails IP address.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
What is almost certainly happening, is that your sshd is not listening on that IP (because it's not on). When you ssh into a jail's IP address that doesn't have a VIMAGE (which this will not according to the guide), then if the sshd is not listening, your FreeNAS's sshd will answer, instead of the one in the jail.

Have you configured /etc/ssh/sshd_config, and have you STARTED THE SERVICE *******IN THE JAIL******** by, in the jail's prompt, typing service sshd start?

To review: You must:
  1. Go into the jail's commandline by either using jexec, or by going into the GUI, highlighting the jail, and clicking the button at the bottom for the shell.
  2. You must set your root password (with passwd), and you'll want a text editor like nano.
  3. You must set /etc/ssh/sshd_config to allow password logins and root logins
  4. You should probably set sshd_enable to yes, using sysrc (as shown in guide)
  5. You must manually start the sshd service with service sshd start
 

madik

Explorer
Joined
May 5, 2014
Messages
54
Thanks for the guide but as long as the jexec command is working for entering the jail Its enough for me.

Was doing the rest of the owncloud guide but unfortunately somewhere after the step 8 (got the "403-forbidden message" success) it went south and the jail IP (http://192.168.1.133/index.php) shows that page is unavailable. Also in the step 11, the top command wasn't showing me any of the user www processes :(
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Here's what I want you to do.

Type "php-cgi" at the command line. Tell me what happens.

If it just sits there, that's actually GOOD, and you can ctrl-c it. But I bet you have an error. And I bet it's about dynamic libraries. Tell me what you have.
 

madik

Explorer
Joined
May 5, 2014
Messages
54
Here's what I want you to do.

Type "php-cgi" at the command line. Tell me what happens.

If it just sits there, that's actually GOOD, and you can ctrl-c it. But I bet you have an error. And I bet it's about dynamic libraries. Tell me what you have.

Well its just: "php-cgi: Command not found."
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
You type php-cgi at the jail's command line, and it says file not found? That's pretty serious, that means most of the dependencies to run owncloud did not install.

When you type "pkg info", do you see a number of php5-related installs? For example, on mine:

Code:
php5-5.4.31  PHP Scripting Language
php5-bz2-5.4.31  The bz2 shared extension for php
php5-ctype-5.4.31  The ctype shared extension for php
php5-curl-5.4.31  The curl shared extension for php
php5-dom-5.4.31  The dom shared extension for php
php5-fileinfo-5.4.31  The fileinfo shared extension for php
php5-filter-5.4.31  The filter shared extension for php
php5-gd-5.4.31  The gd shared extension for php
php5-hash-5.4.31  The hash shared extension for php
php5-iconv-5.4.31  The iconv shared extension for php
php5-json-5.4.31  The json shared extension for php
php5-mbstring-5.4.31  The mbstring shared extension for php
php5-openssl-5.4.31  The openssl shared extension for php
php5-pdo-5.4.31  The pdo shared extension for php
php5-pdo_sqlite-5.4.31_1  The pdo_sqlite shared extension for php
php5-session-5.4.31  The session shared extension for php
php5-simplexml-5.4.31  The simplexml shared extension for php
php5-sqlite3-5.4.31_1  The sqlite3 shared extension for php
php5-wddx-5.4.31  The wddx shared extension for php
php5-xml-5.4.31  The xml shared extension for php
php5-xmlreader-5.4.31  The xmlreader shared extension for php
php5-xmlwriter-5.4.31  The xmlwriter shared extension for php
php5-xsl-5.4.31  The xsl shared extension for php
php5-zip-5.4.31  The zip shared extension for php
php5-zlib-5.4.31  The zlib shared extension for php
 

madik

Explorer
Joined
May 5, 2014
Messages
54
Hmm looks like its problem with the dependencies like you said since they haven't installed apparently.
"pkg info" full results
Code:
gettext-0.18.3.1_1             GNU gettext package
indexinfo-0.2                  Utility to regenerate the GNU info page index
libiconv-1.14_3                Character set conversion library
lighttpd-1.4.35_5              Secure, fast, compliant, and flexible Web Server
nano-2.2.6                     Nano's ANOther editor, an enhanced free Pico clone
pcre-8.34_2                    Perl Compatible Regular Expressions library
pkg-1.3.5.1                    Package manager


And owncloud isnt there..
I did these commands. It wasn't enough i guess.
Code:
fetch "http://download.owncloud.org/community/owncloud-7.0.1.tar.bz2"
tar jxf owncloud-*.tar.bz2 -C /usr/local/www
rm owncloud-*.tar.bz2
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
I must be confused about something. If that's all you have installed, you haven't even attempted to install owncloud.

proceed with a pkg install owncloud.
 

madik

Explorer
Joined
May 5, 2014
Messages
54
Yeah sorry for the troubles. I had some issues early on with pkg update and didnt install the owncloud (pkg install -f helped). Then i used part of the Joshue guide but dint do it properly. Now I processed with the pkg install owncloud and it works now and I can see the owncloud web page. Hopefully it will work from now on. Thank a lot for the guide and Your time!
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Joshua's guide is good, but it takes a different strategy from mine, and it doesn't do much (actually, nothing) to explain what the hell is going on. You can't mix and match his with mine :)
 

rho

Cadet
Joined
Aug 14, 2014
Messages
1
Thanks for this guide, really fantastic in how informative it is. I went from a total command line loser to doing my own troubleshooting etc thanks entirely to this guide. My owncloud is now working internally which is great, however I took on the owncloud challenge because I need to have access and synchronisation from anywhere.
So, my question is what the easiest *safe* way to do this would be - as someone who doesn't have a clear understanding of web hosting and security. Should I use a third party like Pagekite? (how secure is this?) Or is there an easy way to set up a VPN to my home network that will allow me access (grasping at straws for ideas here). Or alternatively should I try hosting a full webserver type thing, in which case does anyone know any guides to do that similar to this one?
Thanks in advance guys
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Well, if you were to open up owncloud to the internet, you'd be taking on the risks, whatever they are, inherent to the web server's (in our case, lighttpd from this guide) vulnerabilities. I suppose you could do that, if you were satisfied that the lighttpd software was sufficiently safe. If you did do that, however, I would recommend only allowing HTTPS mode for connections to your owncloud server. Furthermore, I'd recommend forwarding a non-standard port. This will reduce your attack surface in the first place, and will at the same time decrease the chance of a random hacker realizing a service is listening (and hence, not realizing there's something to go after). I don't know how much you know about the things I just said, but you'll be able to Google them as necessary.

The other option, that almost everyone would be comfortable with, is to set up an OpenVPN connection, and simply use that to tunnel through to get to your OwnCloud. You can Google that as well.
 
Status
Not open for further replies.
Top