Octopress and Nginx

This is an old post. It may contain broken links and outdated information.

Getting Octopress set up took a bit more time than I was expecting, because of the missing libraries issues I encountered. Fortunately, actually putting Octopress published and visible on the web took a lot less time.

The Bigdinosaur.org web server runs the latest stable version of Nginx, an event-driven web server which serves static pages faster than a fat kid eats pancakes. Nginx has a roughly similar concept of virtual hosts as Apache does, and because Octopress doesn’t require any databases and doesn’t use PHP or perl, it can be served with a very simple site definition file.

Most folks tend to be comfortable doing virtual hosts in the Apache way. If you install Nginx on Ubuntu from a repository (there is a Launchpad PPA with the latest stable release, which is several revisions newer than the one in the default sources), you’ll end up with an /etc/nginx/sites-available directory and an /etc/nginx/sites-enabled directory, with the former containing site definition files and the latter containing symlinks to those files, just like Apache. We’ll use those directories here.

Read more

Custom error pages

This is an old post. It may contain broken links and outdated information.

We gain a lot of quick flexibility with running Nginx on our back-end. I’m sure that there are ways to make Ruby & Ruby Rack do lots of nifty things, including fancy rewrites (and indeed theres a good amount of information out there to show you how to do just that), but it’s always going to be faster and more efficient to let the web server handle redirects and rewrites where possible, since it can do those kinds of things without having to pass information up and down the stack to another process.

Rewrites are a rich subject, but none are really necessary for hosting a simple blog. If you’re migrating to Octopress and Nginx from something else and you’ve got a significant amount of posts & history to bring along with you, you might indeed want to spend some time with Nginx’s rewrite module, which isn’t as deep as Apache’s but which is more than capable of addressing nearly every need. Rewrites are such a rich subject, in fact, that I’m not going to go into them any more than I already have. Chances are if you need to set up a bunch of rewrite rules, you’ve already dug up a bunch of other tutorials. For a single-user site with no history or cruft to bring forward, rewrites aren’t necessary; Octopress’s simple static layout is already “SEO friendly,” or at least uses human-parsable URIs.

However, error pages are something that we can quickly and easily customize. Nginx (as with most web servers) lets you specify custom error pages; the problem at first glance is generating a custom error page with the same look and feel as your Octopress blog, and that changes as your blog changes. Fortunately, Octopress’s ability to generate generic pages as well as blog posts comes to the rescue!

Read more

My God, how did I get here?

This is an old post. It may contain broken links and outdated information.

I had a blog once, a long time ago. Blogging is horrible and tiresome activity—one that made me feel rushed when I was updating and guilty when I wasn’t. Yet, here we are.

I think I’m doing this again for the experience of doing it with some modern software. My first blog ran Greymatter, a positively ancient piece of blogging software which its creator had abandoned even before I started using it. It let me shit out banalities as if they were chunks of golden wisdom, but it was clunky and difficult to deal with, though I didn’t know at the time that things got better.

Lately I’ve been hosting my own web site, which you can see by clicking the “Main Site” link at the top of the page. I used Apache on Ubuntu like every other newbie out there, but I knew as I dug more into making Apache do what I wanted that there had to be an alternative—using Apache to host a small personal web site is like your mom using Microsoft Word to write a shopping list. Yeah, it works, but does it really have to be that complex?

Read more