Lavoco::Website - Framework to run a tiny website, controlled by a JSON config file and Template::Toolkit.


Version 0.06


Runs a FastCGI web-app for serving Template::Toolkit templates.

This module is purely a personal project to control various small websites, use at your own risk.

 #!/usr/bin/env perl
 use strict;
 use warnings;
 use Lavoco::Website;
 my $website = Lavoco::Website->new( name => 'Example' );
 my $action = lc( $ARGV[0] );   # (start|stop|restart)

A JSON config file (named website.json by default) should be placed in the base directory of your website.

    "title":"The Example Website",
    "pages" : [
          "url" : "/",
          "label" : "Home",
          "title" : "Your online guide to the example website"

The mandetory field in the config is pages, as an array of JSON objects.

Each page object should have a url and template as a bare minimum.

All other fields are up to you, to fit your requirements.

When a request is made, a lookup is done for a matching url, and that page is then selected.

The page object is available in your template.

It is useful to have pages within a page.

When a page is selected that is a sub-page, an extra key for parents is included in the page object as a list of the parent pages.

This is useful for building breadcrumb links.


Class Methods


Creates a new instance of the website object.

Instance Methods


The identifier for the website, used as the process title.


The base directory of the application, we use FindBin for this.


Flag to indicate whether this we're running a development instance of the website.

It's on by default, and only turned off if the base directory contains /live.

I typically use /home/user/ and /home/user/


Number of FastCGI process to spawn, 5 by default.


The directory containing the TT templates, by default it's $website->base . '/templates'.


Starts the FastCGI daemon.


Stops the FastCGI daemon.


Restarts the FastCGI daemon, with a 1 second delay between stopping and starting.


More documentation.


Rob Brown, <rob at>


Please report any bugs or feature requests to bug-lavoco-website at, or through the web interface at I will be notified, and then you will automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Lavoco::Website

You can also look for information at:


Copyright 2014 Rob Brown.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.