Better Code

Swimming in Someone Else's Pool

Hosting Octopress on BigV

| Comments

Octopress is a very fun little blogging platform. As you can see, it’s what I’m using here. It’s a static site generator with enough bells and whistles to keep me happy, but which doesn’t get in the way.

Anyway, that’s not the point. The point of this post was to demonstrate how I went about provisioning this server. It’s hard to imagine anything simpler.

First: I needed a server. I’ve been working on BigV, so it seemed appropriate to use a BigV vm as a host.

Here’s the top-to-bottom set of commands I used:

1
2
3
4
5
6
$ bigv group new blackkettle
$ bigv vm new diner.blackkettle \
  --vm-discs=25G \
  --vm-memory=1 \
  --vm-cores=1 \
  --vm-distribution=symbiosis

And that’s it. That gives me a machine with the hostname diner.blackkettle.alex.uk0.bigv.io, 25GiB of disc space, 1GiB of RAM and 1 core. Totally overkill for a static site, but the smallest it’s feasible to provision, and I’ve got a little headroom there if I want to get clever later.

Symbiosis is Bytemark’s Debian derivative which not only takes care of a lot of sensible defaults for web hosting, but also automates away boring configuration details by generating DNS and web server details based on directory names.

I connected to the VM’s serial console with bigv vm connect diner.blackkettle, logged in with the root password generated as part of the imaging process, created the folder /srv/blackkettle.org/public/htdocs, and put my public key in ~/.ssh/authorized_keys*.

At this point (given a following DNS wind), anything uploaded to that directory would be served at http://blackkettle.org/. Octopress needs the webroot to be set in its Rakefile. The relevant section for me looks like this:

1
2
3
4
ssh_user       = "admin@diner.blackkettle.org"
ssh_port       = "22"
document_root  = "/srv/blackkettle.org/public/htdocs"
deploy_default = "rsync"

Now, to publish the site in its as-before-you-seen-glory is to do:

1
2
$ rake generate
$ rake deploy

And that’s it. Request a VM, make a folder, upload content. Done.


* This shouldn’t have been necessary. The imaging process should have done this for me. It’s possible I have a bug to track down.

Comments