Home Cloud Server

Using a Raspberry Pi as a internet connected cloud storage solution.

New Conversation

Join the discussion

Log in or create an account, and start talking!

Activity

Colin made a post to Home Cloud Server:

Raspberry Pi 3 boot direct from USB mass storage

One of the issues with a Raspberry Pi was that it is relatively easy to corrupt an SD card if you had power issues or got lazy when switching off.

The Raspberry Pi 3 has the ability to boot from USB mass storage, it does need an up to date version of Raspbian and either latest version of NOOBS or using apt-get to update the OS and then some configuration changes though.Instructions can be found here.

This does change things somewhat, however my owncloud server is running on a Pi 2 so I will need to press my new Pi 3 into service (New?  My old one blew up!) or buy a new one if I intend to go down that route..

Again I stress it will not work on anything but a Pi 3 B and as far as I can see will not work with any of the A series (unless the A 3 when/if it is released may), B, 2 B either Zeros.

Comments

Post a Comment!

Join the discussion

Log in or create an account, and start talking!

Colin made a post to Home Cloud Server:

Making Apache2 ready for Owncloud.

Installing Apache is really easy.  You can have a functioning web-server up and running in minutes.

sudo apt-get update
sudo apt-get install apache2

However Owncloud prefers that a secure connection is used, for this I  needed to ensure that the SSL module is enabled and that a SSL site is enabled to be able to display the data. This also requires a certificate.

The good news is that a self signed certificate is supplied with Apache called "snake oil". if you want to be clever you can create your own, or you can have a signed certificate created.

Getting a signed certificate will stop your web browser from complaining when you connect to the https but you need to provide proof of ownership of the domain at the very least and it usually has a cost.

I was not bothered about a signed certificate so I simple navigated to the sites-available folder and enabled the site, then enabled the ssl module in Apache and finally restarted the Apache2 service.  I keep forgetting the enabling of the ssl module and spend a few minutes wondering why my server refuses HTTPS connections until the penny drops.

So from CLI:

cd /etc/apache2/sites-available
sudo a2ensite default-ssl.conf
sudo a2enmod ssl
sudo service apache2 restart

Now for the database.

Comments

Post a Comment!

Join the discussion

Log in or create an account, and start talking!

Colin made a post to Home Cloud Server:

Adding an External Hard Disk to a Raspberry PI

If you are adding a USB hard disk to a Raspberry Pi using the graphical interface it is fairly straight forward. This is because the drive will auto mount.  The thing is the disk won't automatically mount when booting on to the command line.  You can mount it manually from within the CLI or BASH but we need to drive to be live from boot so the OwnCloud service can use it.

First I had to prepare the disk. I therefore needed to add a partition, a volume and then format the volume for the new drive.  I chose to do this from the Pi.  I could have done all this from the CLI but I have used GParted in the past and find it works really well. So to install GParted from CLI

sudo apt-get update
sudo apt-get install gparted

This meant that I had to load the GUI. I then formatted the entire disk as ext4.

Mounting the drive to persistently (stay mounted after a reboot) ModMyPi have this nice little guide.  This does assume only one drive will be mounted though.  The RaspberryPi-Spy has another guide to allow for multiple drives to be added.

The only amendments I made were to identify the volume as ext4 and not NTFS and the different path to the drive root. The line now reads:

/dev/sda1 /mnt/usb /ext4 defaults 0 0

As Sudo I created the two folders /mnt/usb. Without these folders the drive will not mount.

Comments

Post a Comment!

Join the discussion

Log in or create an account, and start talking!

Colin made a post to Home Cloud Server:

Running Headless

The Pi is going to be open to the internet and running various web and database services.  Your Pi does not need to startx automatically, also you probably don't want to automatically login either. The RaspberryPi-Spy has a really good article on this:

http://www.raspberrypi-spy.co.uk/2015/09/raspbian-configuration-utility-and-new-boot-options/

While changing the boot options it is probably a good time to change the Pi account password, especially if you are opening up SSH to the internet.

Actually it may be a good idea to change your user name as well, this is a bit more complicated because you need to allow login direct from Root to login and then change the user name. Alternatively a new admin account and then add to the sudoer group to login as that account to either remove or change the Pi account.  Using Root, it is imperative that the account is de-activated after the Pi account is changed.

Back to Headless.  Now the Pi when started up, will not automatically login and load the graphical interface. As long as the Pi is connected to the network a telnet client like Putty will allow connection to the command line.  If you want, you still can login directly to the Pi and access the graphical interface.

Comments

Post a Comment!

Join the discussion

Log in or create an account, and start talking!

Colin made a post to Home Cloud Server:

Dynamic DNS

The Dynamic Naming Service (DNS) is the service that allows an IP address be given a meaningful name, stopping the need to remember numbers whenever you need to access a web site, printer or share on your network,

Every home router has an external address presented to the internet, but an ISP usually won't  give a router a static address so your external address may change from time to time. you could keep track of this and change it whenever you access your network or you can us a Dynamic DNS service.

I use No-IP.  No-IP provides a free service for up to 3 hosts on one of their domains, the drawback being you have to confirm the host every thirty days (Sorry that sounds like a advert).

Firstly sign up and add a host.

Now the there needs to be an agent installed on the the Pi to keep the IP address up-to-date.  No-IP does supply a guide but the TheAverageManVSRaspberryPi has a slightly better one that includes how to make the service start automatically on start-up.

http://www.averagemanvsraspberrypi.com/2013/09/using-raspberry-pi-as-noip-client.html

Comments

Ollie commented on Dynamic DNS:

Hi Colin, I know that some broadband routers have a built in agent that can update a dynamic dns service automatically as soon as the ISP assigns an address. I have a BT home hub which has it.

Colin replied:

Hi Ollie
Thanks for that. That's a really great function that should be on my Super Hub!
As the Pi in question is the only device providing services over the internet, I'm happy to use the no-ip client for linux, there is a small issue over boot order as the application goes live before the network connection has formed so the i.p. address is set to 0.0.0.0 . However the time out is 30 minutes so it does catch up eventually. At the moment I'm grappling with activating SSL on the Apache2 web server. I've had this working many time before but it steadfastly refuses to work. HTTPS is required for ownCloud.

Colin replied:

fixed sudo a2enmod ssl
:) School boy error.

Respond

Join the discussion

Log in or create an account, and start talking!

Post a Comment!

Join the discussion

Log in or create an account, and start talking!

Colin made a post to Home Cloud Server:

What is Needed

The idea behind this is to have a storage solution that is available "out of the house"  I have a RPi 2 which has a faulty GPU so will only display 640x480, I can get the Pi up and running and then use the command line to do all the work as the server will run headless.

To complete this project you need:

  • A Raspberry Pi 2 at least. (You could use an old PC for that matter with Linux installed but a large capacity hard disk is needed)
  • An external USB drive.
  • A NO-IP.org account to enable dynamic DNS.

The installation requires the following software installed:

  • LAMP Stack for Web Services (L.inux A.pache M.ysql  P.hp)
    • APACHE2 web-server
    • PHP5 (At least 5.4)
    • MySQL
  • PHPMyAdmin (to administer MySQL via Web GUI)
  • ownCloud8 (Dropbox type cloud services)

Taking it a step further I'm also going to install:

  • Webmin (A Web GUI to administrate the server)
  • MiniDLNA (lightweight DLNA server for streaming media)
  • Transmission Daemon (web based torrent server)

Comments

Post a Comment!

Join the discussion

Log in or create an account, and start talking!

Colin made a post to Home Cloud Server:

RPi Cloud

While I have a solution in place it has grown rather than been designed, it takes up a fair amount of  space on the desk required two separate power supplies.

Western Digital have released the PiDrive, a 314 GB Raspberry Pi optimised hard disk. So with this, the enclosure and the cable I can have an "all in one" solution working with a single power supply.

This is kind of re-inventing the wheel, but I can document the project here and build the device as a working server and not the developmental/experimental solution it was in the past.

Comments

Post a Comment!

Join the discussion

Log in or create an account, and start talking!