A Whirring Box in the Corner

There are many advantages to using Jekyll, most of which have to do with its resilience. Posts are written in Markdown before being rendered into a static HTML site. This means that there's no server-side processing going on every time someone wants to view a post: instead the HTML and CSS are pulled off the hard drive of the server and sent directly down the pipe to the user.

GitHub also supports Jekyll, meaning you can host your blog on their servers using GitHub pages and so you never have to worry about going down due to high load (or as Reddit would call it, the "hug of death" that your server gets when one of your articles becomes popular). This is fantastic if you're the kind of person who regularly gets to the top of Hacker News or Reddit or some other news website. This, however, isn't the case for me most of the time (other than the notable exception of my Door Sign post which was my most-viewed by far - 32,300 pageviews), and so it's not a huge concern for me. Also, I doubt that the traffic I get would ever be enough to take down a normal server.

The fact that Jekyll's advantages don't have a huge effect for me, combined with the major irritation that I can't write or publish anything on a device that doesn't have Ruby and Git installed, meant that I was looking for somewhere else to put my blog.

I briefly considered Squarespace, since I recently set up my school's Young Enterprise team with them, but I figured I'd rather try something I could host myself, especially since $8/month is more than a DigitalOcean VPS or $0 for self-hosting. As such, I stumbled upon Ghost. I considered their hosted option but thought I'd rather have control over my environment.

I've had a Mac Mini sitting in the corner of my bedroom for a while now. Previously, it had been hosting a couple of my small off-project sites like my repository of screenplays and one or two of my Little Printer publications. It had also been a server for personal use, as it has Plex Media Server running on it with a 2TB media drive attached to it, as well as my 8TB project drive and multiple Time Machine backup drives. It had never, though, been something that was really useful in a production environment: it was running OS X 10.9.3 and had OS X Server installed, meaning that I couldn't really take advantage of Apache or nginx without some weird port mapping (given that even when "Web Sharing" is off, port 80 doesn't become available for use).

Then it dawned on me: virtualisation was the answer. The first thing I did was to format the boot drive of my Mac Mini so that I could install 10.10 on it fresh. Then, I installed VirtualBox and created a Ubuntu 14.10 Server virtual machine, which lives with its own IP address on my home network.

I then changed it so 80, 443, 22 and a bunch of other useful ports pointed at the new Ubuntu machine instead of the Mac Mini itself, but I kept Plex and AirServer and AirParrot running on the Mac.

(For future reference, since I'm a fan of P.G. Wodehouse, I named my Mac Mini Jeeves and the VM Spinoza.)

I tried briefly to install Dokku on Spinoza, until I realised that a) it hogged port 80 and there was nothing I could do about it and b) it was extremely difficult to uninstall, with the prevailing advice being to "reinstall the OS". I decided that I'd keep my tiny DigitalOcean VPS running just as a VPN and Dokku server and host sites manually on Spinoza.

After failing a few times, I finally managed to get Ghost up and running with NodeJS on Spinoza, along with nginx as the main webserver proxy-passing to whatever npm uses as its webserver.

I imported my posts over from Jekyll using this simple script, and then manually went through and made sure that all the images were where they were supposed to be (they weren't).

The last thing to do was to make some alterations to the default Casper theme so that my Disqus comments carried over from the old site, as well as a couple of aesthetic tweaks that made it look better (in my opinion). I've published the theme I'm using on GitHub as a fork of the original so I can continue to pull updates from it as I need.

The only thing that's missing from Ghost is an iOS app (including iPad) that lets me write natively and upload images (which the mobile admin interface can't do yet), but I'm sure that will come with time as Ghost's popularity continues to grow. Hell, I might even have a stab at it.

So for now, until I have something to write about that isn't about the blog itself, this is Alex, signing off.