QZ qz thoughts
a blog from Eli the Bearded

How It Works

So one thing you don't find in most blogs is a peel-back of how the blog actually works. Even the current Blosxom page (which I think is a copied static rendering, without any actual running Blosxom anymore) fails to give a whole lot about how it was configured.

I'd like to get that out of the way first. This is currently running blosxom-2.1.2 powered by whatever my ISP has installed as perl-latest (today that is v5.24.3, but they update as needed) on a NetBSD 8.1 server (subject to updates) with Apache/2.4.41 (and, again, subject to updates). From my point of view, what I get is a directory in which I can put things, including .htaccess files and system tools and libraries I can use. But I don't have root, I can't configure Apache beyond what's allowed in .htaccess, and I'm not installing new system tools and libraries.

So what's in the .htaccess files? At the root of /qz/ I have this:

DirectoryIndex blosxom

  SetHandler cgi-script

AddOutputFilterByType DEFLATE text/html

RewriteEngine on

RewriteCond %{HTTP_HOST} !^qaz.wtf [NC]

RewriteRule ^(.*) https://qaz.wtf/qz/$1 [R=301]

The first line makes the extension-less blosxom script run for an access that doesn't go to a particular file. Next, I make that script behave as a CGI program, then I enable compression for HTML files, finally I turn on the "RewriteEngine" and set a case insensitive match on the hostname, if it's not "qaz.wtf" then redirect to the qaz.wtf form with a 301 "permanent" status. This will update people (search engines) that have the old panix.com URL to use the new one and also get people to not use "www.qaz.wtf". Don't get a seven character domain name and use it as an eleven character name is my motto.

Inside other directories I have different .htaccess rules like setting a GIF for directory index in the images directory; adding a "deny from all" rule in the data directory, blocking access to a few other directories, plus one more more I'll share below.

What I will show you, if you want, is the plugins/ directory and the code in there, as well as notused-plugins/ which has some others. Given that Blosxom is a rather dead tool, finding some of those required a bit of digging. I've included an unconfigured copy of the Blosxom CGI script in the notused-plugins directory, too. The actualy configuration in the script is pretty trivial, mostly just setting the directory names and base URL. Mine looks something like this:

# What's this blog's title?
$blog_title = "QZ redux";

# What's this blog's description (for outgoing RSS feed)?
$blog_description = "Queasy, a blog.";

# Base installation
$installdir = "/htdocs/userdirs/eli/qz";

# Where are this blog's entries kept?
$datadir = "$installdir/data";

# What's my preferred base URL for this blog (leave blank for automatic)?
$url = "https://qaz.wtf/qz/blosxom";

# How many entries should I show on the home page?
$num_entries = 4;

# Where are my plugins kept?
$plugin_dir = "$installdir/plugins";

# Where should my plugins keep their state information?
$plugin_state_dir = "$plugin_dir/state";

That leaves out all the settings I didn't change. Besides the configuration of the software, there are the "flavour" templates for Blosxom. These are sets of templates with the same suffix (which is the flavour name). But just because the suffix looks like a file type, doesn't mean it is. The content-type.suffix file gives the type for that flavor. Both the .html and 1993 flavors in mine are HTML. One is kinda modern, should be HTML 5 but probably doesn't validate and the other is HTML 2.0. Take a gander at the templates I have today, 23 Feb 2020: /qz/flavours/. I also include a readable copy of the htaccess file there, showing how I disabled the HTML mimetype. It was moderately tricky, so I'm sharing.

Lastly, you can look in the CSS directory for my stylesheet(s). At present, there's just the one.

Right now, I code these blog entries by hand in vim, but I may write myself a helper tool or find some sort of markup-to-html plugin. Probably not markdown markup, because I'm really not a fan of how links/images/dictionary lists work in that system. I'm almost certainly going to make a from-my-phone method to create entries, and when I do, I expect to create posts explaining how those tools work. I want to show how the sausage is made.