How Interblah Works

Written on October 13 2009 at 12:45 and updated on April 26 2011 at 22:14

Murray asked for an overview of how this site is put together, and here I am obliging.

From the server perspective, this site runs on a VPS, under Apache and Passenger. interblah.net is an Apache virtual server; here’s the config:

DocumentRoot /var/www/apps/interblah.net/public
<Directory "/var/www/apps/interblah.net/public">
allow from all
Options +Indexes
</Directory>
ServerName interblah.net
ServerAlias www.interblah.net
Alias /assets "/var/www/apps/interblah.net/assets"
RedirectMatch 301 ^/2006/\d+/\d+/(.+) "/$1"
RedirectMatch 301 ^/2007/\d+/\d+/(.+) "/$1"
RedirectMatch 301 ^/2008/\d+/\d+/(.+) "/$1"

The Alias directive is something I’ll probably lose, now that public is a proper directory in a Vanilla application, but exists to support URLs from older incarnations of the site; likewise for the Redirects, which handle old Mephisto URLs.

Passenger is configured to use Ruby Enterprise Edition, since I have a bunch of other sites on the VPS and want to conserve memory.

The contents of /var/www/apps/interblah.net are available on github; this is the site directory that Passenger runs.

Here you can see the config.ru that boots the application; this requires vanilla, which is normally the latest vanilla gem. Previous incarnations of my site ran directly off the vanilla source, which was useful for tweaking the system, but made it much more complex to deploy. By making the Vanilla code external, the site contents itself can be packaged into source control and deployed directly.

The Vanilla gem depends on a few other gems, all of which will be installed automatically when installing the vanilla gem:

The most important of these is the soup gem. When the appliation starts, the application instantiates a ‘soup’, based on a subdirectory of the site code (here is interblah’s). That directory is defined by default in the site’s config, passed in the config.ru

The config.ru pushs a local lib path at the start of the $LOAD_PATH, which is intended for dumping site-specific code, although I haven’t used this yet. The public directory is also a part of the site, for custom images and CSS and whatnot. Finally, the tmp directory needs to be there for Passenger to work. You’ll see in the interblah source that the lib and tmp directories are missing; this is just because git won’t store empty directories.

I have a few other gems installed for various dynasnips that I’ve written specifically for interblah.net

Hmm - this is a bit rambly, so here is…

Summary