A Delicious Serving of Raspberry Pi

You are viewing a WordPress blog post served up by a Raspberry Pi 2 Model B sitting in my living room.

This post is living proof that I have completed an initial foray into some serious Raspberry Pi server functionality, albeit with a few glitches (photos are not now showing). I have not yet gotten a case for the Pi Drive – it is resting in the foam packing it shipped with. I am looking at either printing one – or using the small stacking case from WD themselves.

20160210_200805

I was only intending to test operating systems, but my primary file and print server (of the last 5 years) went down with a power outage, and didn’t come back up properly. I could boot it with a CDROM, but while attempting to fix its boot problems (and it is using RAID5 with 3 hard drives), I munged up the OS and got into apt-get hell. So I thought to myself – why not expand the scope of the project? It’s not like I don’t have enough on the go, right?

I had a lovely little piece of kit from Western Digital – a Pi Drive, which is a 1 TB hard drive in 2.5″ form factor, with a nice little Y cable and a power supply for both the Pi and the drive. Turns out I only have 500 GB of data, so this is perfect for now. If all else fails, I can use the drive as a backup and I can wipe the big server and reinstall.

Note that I have a Wi-Pi Wifi adapter (which I later remove as I am not using it) in the picture. Strangely, the much smaller Edimax adapter gets a better signal than the Wi-Pi. I will also be ditching the display, and the large(ish) box, as I don’t need it – and both are designated for another project.

Pi model 2 with Pi Drive and 7 in Display

However, I am a real cheapskate, and an environmentalist (if for no other reason than I am a cheapskate). It has always bugged me that my server chews down over 100W continuously, 24/7, 365 days a year. The Pi draws about 1W when idle, and the Pi Drive probably about the same. So I thought to myself – lets see if we can get file and print serving up and going, see what performance is like, and then I can futz around porting web-site stuff and anything else I used to rely on the old server for. I didn’t want to get bogged down learning a new distro’s package manager, but I had noticed a new kid on the block in the form of Minibian – a stripped down version of Raspbian, my favourite Pi OS. I gave that a shot – since it uses the familiar debian package manager. It has not let me down. There were no issues whatsoever in getting packages installed and configured to my liking.

My first priority was getting my data copied over. It took about 11 hours to copy over 500 GB of data (mostly videos and music). I quickly set up NFS exports, so now I can get to my stuff from all the other computers as before – except if I boot Windows (which is rarely). I still need to setup Samba to complete this task. While still on the basics, I configured cups for printing from my Linux machines – and to my joy I also discovered a ChromeOS extension for printing to cups. That – after some configuration glitches – was accomplished, so now I can print from Linux or our Chromebooks, 90% of our needs. Samba will deal with another 9%. The missing 1% I hear you ask? I will need to install the Chrome Browser and add the Google Cloud Print extension. Hey – I just discovered the Google print cups connector!

I have also installed owncloud – a personal cloud solution, to wean myself off of reliance on Google and Dropbox. So far, owncloud works pretty well. It even has a document creator – using Libre Office as a back end, although for now it only supports docs, not spreadsheets or slides. I am quite impressed – and it is under an Apache open source license.

Initial trials with my web sites were a little more discouraging. I got blank pages, or only the static content. I decided while doing all this I might as well switch to mariadb instead of mysql. That installed fine, and I simply manually copied my ISAM and InnoDB tables over. I then basically ported all my apache “sites-enabled” over, put the right passwords in the right places, and very little worked. I fiddled around for a day or two – before I discovered that I had a broken wordpress theme. I activated the twenty-fifteen theme and suddenly all my sites worked. So – wordpress is working well – this post is on the new WordPress Blog, successfully ported to a Raspberry Pi 2. Soon after that, I installed the current version of the twenty-ten theme for which all my header images were customized, and we were gold.

Now for my old php driven D&D sites. I maintain a 3.x edition character database and pdf producer of nice character sheets and a spell database which is great for choosing and printing spell books. I want to upgrade these to do both Pathfinder and 5th edition. So far I have partial success. I am confident I will soon have everything working.

I would also like to get an e-mail server working. I used to run my own for about 10 years, on a Linux server. I gave it up when google became the defacto provider, and I had moved once too often to want to be without e-mail for 3 days while ISPs failed to live up to their installation agreements. I have installed postfix, which came with an unexpected challenge. The upstream debian posfix package had a requirement for either mysql or postgresql. I was using mariadb. After forcing it to install anyway, I still got error messages blocking my progress with every subsequent apt operation. I bit the bullet and hand-edited the .deb package to allow mariadb-server as an alternative. Something the package maintainers themselves ought to do. However, it was quite easy, and I learned something new in the process. All good. I then needed to use the same trick for mediawiki, which installed fine once I added mariadb to the “recommended” list in the control file.

Postscript:
I will add posts giving detailed technical HOWTOs for various portions of this project if people show any interest. Let me know!

PPS:
Also based on interest – I will create a unified configuration system for all the local configuration (server name, domain, user logins, outgoing smtp etc), and an SD image for download. I may need to create a kickstarter for this (at least so I can justify all the time to my wife).

This entry was posted in technical. Bookmark the permalink.

3 Responses to A Delicious Serving of Raspberry Pi

  1. Nick Kessler says:

    I have a Pi that I’d like to set up as a web server. I’d be glad to see a tutorial!

    • Dominic Amann says:

      Thanks for the comment, Nick, and I will work on the howtos soon.

    • Dominic Amann says:

      I have added a HOWTO using mediawiki (also being served from the pi). I will be extending this HOWTO as time allows. For now it covers everything up to getting the hard drive all setup up and made available.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>