Apache::Blog - mod_perl weblog handler


In httpd.conf

  Alias /blog/ /home/daniel/blog/
  <Location /blog>
    SetHandler perl-script
    PerlHandler +Apache::Blog


Apache::Blog is a simple handler for online diaries. At the moment it works on the one-entry-one-page paradigm, but would be easy to apapt to multiple entries per page if this is prefered. In the future this will be a configuration option.

It is inspired by the service offered at

It uses HTML::Template, so it is easy to design new layouts. There are some samples included with the distribution.

All diary entries are stored as plain text files, there's no database stuff going on here. This is to make it simple to add entries - any editor can be used to write entries.

To use, decide on a directory which is to hold your weblog entries, and set PerlHandler like in the example. The alias isn't nessasary, but I like it that way.

Also in that directory need to be two template files, one called entry-template.html, and one called older.html.

Entries take the format:

  Short Title
  Thu Jun 20 17:24:52 BST 2002

  The entry down here.

The date can be in any format that Date::Manip likes. In vim I do :r!date to add the date line.

Apache::Blog does some simple manipulation on the text. It will turn lines which start with a * into bullet lists, and blank lines are turned into <p> tags. You can also *bold* text. It doesn't highlight links or anything. A more sophisticated text->html converter may be included in the future.

The module can also allow comments on entries, for this to work properly the webserver must have write access to the directory containing your entries.

Entry filenames can be anything you like, as long as it doesn't end in .html or start with a period. I generally go with filenames like "2002-06-20"

See the sample layouts, especially the "simple" layout, to see how to create your own.

Someone should write a blogger -> Apache::Blog template converter, one for diaryland templates as well. Best way to do that would probably be an HTML::Template filter so it's transparent. There's a lot of templates for the different services out there so that's probably a good itch to get scratched.


Daniel Gardner <>


HTML::Template, Date::Manip