How Interblah Works

; updated

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. is an Apache virtual server; here’s the config:

DocumentRoot /var/www/apps/ <Directory "/var/www/apps/"> allow from all Options +Indexes </Directory> ServerName ServerAlias Alias /assets "/var/www/apps/" 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/ are available on github; this is the site directory that Passenger runs.

Here you can see the 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

The 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

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