*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: Private cloud server at home with the XO laptop  (Read 8388 times)

Private cloud server at home with the XO laptop

eden
Global Moderator
Master Contributor
****
Posts: 420


G1G1 2007, 2008


December 18, 2011, 08:15:59 AM

With the threat of SOPA and news around the world about countries shutting down and censoring the Internet, I find this interesting:

http://owncloud.org/

The creators have even made a "try-it" page: http://demo.owncloud.org/files/index.php

I'm a fan of the Freedombox Foundation and I have a (as of yet unhacked) Pogoplug.  I like the idea of controlling my own data, inasmuch as possible.  This program has a web interface that reminds me of Pogoplug's.

We know that the XO doesn't consume a lot of power, doesn't get hot.  I wonder how this program would work on it.  It requires webDAV and "Apache, PHP 5 and either MySQL or SQLite."  I wondered if Fedora with Sugar or Puppy Linux would be better as a base for it.

Does anyone have any experience with it, or any ideas about ownCloud and the XO? 

Logged

#1 Re: Private cloud server at home with the XO laptop

anna
Master Contributor
***
Posts: 326


December 18, 2011, 11:48:33 AM

I actually did look into something like that this summer after hearing that the Egyptian gov't was shutting down internet connections.  I had read about the Pirate Box http://wiki.daviddarts.com/PirateBox and thought that the XSXO could have similar functionality.  Owncloud certainly looks interesting and has a nice looking interface.  Certainly worth a try.

Anyway, here's what I tried this summer:

I tried to think of how best to make everything accessible from any wifi-enabled device no matter the platform.  I also didn't want users to have to create logins.

There are a lot of cool utilities out there, but the problem I ran into with the XS on the XO-1 was MySQL.  Just couldn't get it to work.  Disappointing, as my users really like the Statusnet (opensource Twitter) installation on my regular XS, which requires MySQL.  I didn't try SQLite.  So I had to find tools that only required Apache and PHP.

So, I set about to figure out how to set up an XSXO so folks could chat live, leave messages (think electronic bulletin board), and share files.  And all with just Jabber, Apache, and PHP.

Jabber works great on the XSXO, which takes care of chat.  In fact, when I go out of town, instead of keeping my big old Dell on, I'll fire up the XSXO and my users can't tell the difference.  You do have to register an account to use it from a regular chat client like Pidgin or Adium.  To get around that, you could set up MUCkl, which lets you join persistent chatrooms from a web page.  In fact, it works from the Kindle 3 browser.  Setup is a hassle, though.  http://www.ejabberd.im/muckl

As with any Apache installation, folks with login credentials can scp stuff up to their web directories.  But what if you don't have a login?  You can upload files from a PHP form.  Unfortunately if the file is larger than /tmp, it'll fail.  I tried mounting a 2 GB USB drive on /tmp, but it didn't like that for some reason.  I don't remember what the file size threshold was, but it seems like it was a couple hundred MB or so.  However, it's extraordinarily easy to set up.  Here's my writeup on the server-devel list:

http://lists.laptop.org/pipermail/server-devel/2011-June/005675.html

For the "message board" I used flatPHPbook.  It doesn't require a database and is also really easy to set up.  http://flatphpbook.sourceforge.net/features.html

For folks in the same physical space, you can hook up a wifi AP to the XSXO on eth1.  The XSXO has dhcp already configured.

If you're wondering about moodle on the XSXO, I've found it rather too big, heavy and clunky to work very well.  Not to mention the administration headaches if users are required to have logins.  Registering an XO to the XS automatically takes care of that, but an admin has to manually add users for other devices, which is probably too much of a bother.

Anyhow, that was my roadmap of turning an XSXO into a device to facilitate anonymous communication and sharing.
Logged

#2 Re: Private cloud server at home with the XO laptop

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


December 18, 2011, 01:14:03 PM

I really do not know much about server configuration (that can be a big security hole if not done properly) but I think you can get the dependencies for owncloud in fedora14 (os874) by
Code:
sudo -s
rpm -Uvh http://rpms.famillecollet.com/remi-release-14.rpm
yum --enablerepo=remi install httpd php php-common php-sqlite system-config-httpd
They install with no complains and take only 20MB installed.
system-config-httpd is a GUI configuration tool for apache
Now getting the Apache going is a different story. Maybe this is a starting point

PS: If you get complains for missing "something" in apache when you install owncloud, try
Code:
sudo yum groupinstall "Web Server"
« Last Edit: December 19, 2011, 10:50:22 PM by mavrothal » Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#3 Re: Private cloud server at home with the XO laptop

eden
Global Moderator
Master Contributor
****
Posts: 420


G1G1 2007, 2008


December 18, 2011, 06:09:44 PM

Wow, you both are amazing!  Now I need time to try this.  Hope to let you know during the holidays how it goes.
Logged

#4 Re: Private cloud server at home with the XO laptop

anna
Master Contributor
***
Posts: 326


December 18, 2011, 09:52:12 PM

This is  an ill-advised install.  You probably shouldn't do this.

I tried to get owncloud to work, but it doesn't seem to work on the XO-1  Best I can get on  the F14 XO-1 install is the login form.  For now.

I installed:

httpd php php-common php-sqlite sqlite php-mbstring php-xml php-pdo  

Also this:

git-core

I got the source from git into /var/www/html.  Anyway, I couldn't get it to work tonight.  Maybe eventually I will.  

I hope this works, but don't be sad if it doesn't.

EDIT:  I got it to work by doing this:

mkdir /var/lib/php/session
chown -R apache:apache /var/lib/php/session

But, one of the difficult things working with a "regular" OLPC build is that you're not supposed to mess with things like that.  So, it's not persistent on reboot.  But technically, I got it to work and uploaded a file.
« Last Edit: December 20, 2011, 02:32:49 PM by anna » Logged

#5 Re: Private cloud server at home with the XO laptop

Dinky
Senior Contributor
**
Posts: 238


December 19, 2011, 02:45:09 PM

What am I missing here ?

XS on XO.  XO can connect.  SoaS can connect.
Chat, share files, persistent bulletin board if one client leaves a Write Activity open.

Once, even had pidgin communicating with XO via jabber.

Is this not the basics of a quick setup emergency site?

What would help is XO Chat emulation in pidgin.
« Last Edit: December 19, 2011, 03:32:03 PM by Dinky » Logged

#6 Re: Private cloud server at home with the XO laptop

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


December 19, 2011, 10:54:51 PM

What am I missing here ?

I think owncloud's main goal is to have your own devices synchronized with your own server without the big-brother snooping in your files (unless he really wants to... Shocked).
Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#7 Re: Private cloud server at home with the XO laptop

eden
Global Moderator
Master Contributor
****
Posts: 420


G1G1 2007, 2008


December 20, 2011, 08:13:01 AM

This is  an ill-advised install.  You probably shouldn't do this.

I tried to get owncloud to work, but it doesn't seem to work on the XO-1

Thank you, anna.  So Fedora 14 is out.  I will still try it, maybe on Puppy.  I've wanted to get all wild and crazy and roll my own distro for the XO ever since mavrothal explained how : http://www.olpcnews.com/forum/index.php?topic=4879.msg33489#msg33489
« Last Edit: December 20, 2011, 08:15:59 AM by eden » Logged

#8 Re: Private cloud server at home with the XO laptop

anna
Master Contributor
***
Posts: 326


December 20, 2011, 02:35:12 PM


Thank you, anna.  So Fedora 14 is out.

I gave it one more go and got it to work on a fairly "stock" F14 official build.  I edited the relevant post above.  It's just proof of concept at this point, though, and really not ready for "primetime."
Logged

#9 Re: Private cloud server at home with the XO laptop

anna
Master Contributor
***
Posts: 326


December 20, 2011, 05:47:52 PM

Since I got owncloud working on the XO-1, I've been messing with it a little bit.  Obviously, you can't store very much on the XO itself, but you should be able to mount an external device on /var/www/html/owncloud/data or specify another directory (e.g. the path to an external drive) when you initially register the admin account.  Not an insurmountable obstacle.

Since the filesize default is 2M, it does help if you change the default file upload size in /etc/php.ini by editing the values on these lines:

upload_max_filesize
post_max_size

...but you'll still run into the constraints of /tmp.  Opencloud writes data to /tmp while uploading from the web interface.  So you're going to run into a 50M size limit unless you change the size of your /tmp and/or fool with another external device.

You might be thinking, "Well, I'll just transfer my big files to the external drive before plugging it into the XO."  That's not a bad idea.  The problem is going to be ownership and permissions.  Of course that means a FAT32 formatted drive is not going to work, as FAT32 doesn't preserve permissions.

When you create an owncloud user through the web interface, that user gets a directory under /var/www/html/owncloud/data when that user initially logs in.  For example, as the user "admin" I create a user named "leroy" and set leroy's password.  When leroy logs in for the first time through the web interface, only then is /var/www/html/owncloud/data/leroy created.  When leroy uploads a file, it goes into /var/www/html/owncloud/data/leroy/files.  Done though the web interface, apache owns that file.

So, when leroy says, "Hey, I've got a really cool video I want to share on owncloud, but it's 200M," that's when you might run into permissions issues.  Lemme go ahead and shut down the XO hosting owncloud and hand leroy the ext3 formatted drive.  If leroy has a Windows machine?  Um, no clue about that, so let's just assume leroy is using a Linux desktop.  Depending on how the drive mounts, he'll probably have to copy the file over as root to leroy/files, since apache owns everything on the drive.  But at least movie.avi is now in his owncloud directory.

On the XO, I mount the owncloud drive and then, as root, chown -R apache:apache /var/www/html/owncloud/data/leroy/files.  Otherwise leroy won't have full permissions to his stuff via the owncloud interface.  However, how the XO serves up that 200M file is something I haven't tested yet.

So then I wondered how WebDAV would do.

When I click on the gear symbol in the lower left, I selected "Personal."  That's where you change your password and stuff.  I noticed this:

WebDAV http://172.18.97.4/owncloud/files/webdav.php

Where that IP address is the XO on my LAN.  So, in Nautilus, I go to File -> Connect to Server.  In the dialog box, I select Type of WebDAV, enter the XO's IP in the Server box, then enter owncloud/files/webdav.php for the folder.  Plug in my owncloud login credentials, and WOW!  All of a sudden my owncloud dir appears as a network drive.

Curious, I tried copying over a 115M file, but threw a few errors and it only copied over 35M.  Not sure why, as nothing happened in /tmp and I had about 275M of space available on the XO.  When I scp files over to an XO, I usually don't run into any issues.  I do realize WebDAV is not scp, but since it wasn't caching stuff in /tmp, I was hoping it would work in a similar fashion.  Apparently it does not.

Now, in all this messing about, I wanted as little overhead on the XO as possible, so stayed in single user mode.  The conclusion I've drawn from this evening's little adventure is that an owncloud XO does have potential to be a valuable asset on one's LAN.  Emphasis on the word "potential."
Logged

#10 Re: Private cloud server at home with the XO laptop

eden
Global Moderator
Master Contributor
****
Posts: 420


G1G1 2007, 2008


December 20, 2011, 08:55:59 PM

Wow, anna, you rock! 
Logged

#11 Re: Private cloud server at home with the XO laptop

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


December 20, 2011, 11:00:01 PM

Wow, anna, you rock!  

+1  Grin

Can't wait for take 3!

3 questions
Are (some of) the rpms from the "remi" repo or just Fedora 14?
Do you need a static IP for the "serving" XO? eg can it be on your home DSL connection if is to be accessed from outside?
Is "stock fedora" os874? (yum updated?)
« Last Edit: December 20, 2011, 11:14:18 PM by mavrothal » Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#12 Re: Private cloud server at home with the XO laptop

anna
Master Contributor
***
Posts: 326


December 21, 2011, 12:16:17 AM


Y'all don't know how happy I am to read that, eden and mav.  Thank you very much.  Big smile on my face here in Alabama.

To answer the questions:

Are (some of) the rpms from the "remi" repo or just Fedora 14?


I trusted your guidance, mav, so I did install stuff from the remi repo as much as I could.  I've used remi for years, so I know stuff from his repo is the freshest when it comes to some things.

Do you need a static IP for the "serving" XO? eg can it be on your home DSL connection if is to be accessed from outside?

We're getting into networking stuff now.  Personally, I have a static IP and now I associate that to a domain name, but "back in the day" my users got along with simply my IP.  One of my friends uses no-ip for his dynamic home IP to associate to his URL.  (There are multiple other services out there, so do not see this as an endorsement.  It's only an example.)

Basically you need to know your external IP, whatever it is, and then tell your router to forward whatever ports to the outside.  You don't have to run httpd on the XO on port 80.  In fact, I'd suggest you don't, since you're just asking for hassle.  That way users need to know the port as well as the URL or IP address, which minimizes attacks.

If you only want to use opencloud on your LAN, unless your dhcp server goes wonky, the IP the XO gets from the dhcp server should be stable enough.  And if you lose it, that's what nmap is for.


Is "stock fedora" os874? (yum updated?)


It's "stock fedora" os883, OS 11.3.0.
Logged

#13 Re: Private cloud server at home with the XO laptop

why
Contributor
*
Posts: 36


May 03, 2012, 12:30:35 PM

This forum implies you'd be interested in using the XO-1 as a server, right?

Actually researched that a bit but nobody has a simple solution that's been posted here, some of the senior members report using these simple machines as servers for site membership but not for "Wifi" (Cloud Server) connectivity in a home environment.

I'm supposing you're already aware of how PogoPlug works?  You connect a usb drive to that hardware device, content becomes available across an internet connection.

So all you'd have to add is a Wifi router to connect to.  If that router is connected to a home internet (cable) ISP you're good to go with a device that connects to it and logs onto the PogoPlug site.

I personally use a Kindle Fire to connect but also own a Galaxy (Samsung), they're both easily connective to the PogoPlug server site.

So if you already own a Wifi router, you're looking at a $100 investment for the PogoPlug device, then $200 for a Kindle, or $350 range for the Samsung.

If you're strapped for $ maybe a senior member will devise a solution using the XO-1 but as I've pointed out you could have a home "Cloud" with an investment in the $300 range, given that you've already purchased the Wifi and have a home internet connection.

Just my take on it, have fun ;-)
« Last Edit: May 03, 2012, 02:06:25 PM by why » Logged
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 43
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 20
Total: 20