[ svnb ] - Installation Instruction

[ svnb ] can be installed in two configurations:

Please follow the general installation instructions which installs [ svnb ] as a CGI script. Later, you will see how to install [ svnb ] as a mod_perl handler.

General installation

Download [ svnb ]

The latest version of [ svnb ] can be downloaded from here..

Directory structure

The extracted package will create the following directory struture:


Move the content of the cgi-bin directory to your cgi directory. Move the contents of the htdocs directory to your homepage directory. The perl directory contains the mod_perl handler. For cgi based scripting, the Perl script svnb.pl (inside cgi-bin) will use this directory (with the use pragma).

Let's just change dir to you folder, unzip and locate the target directories. Assumption is, your home drive is /home/folder/mine. Your ~/cgi-bin directory serves cgi scripts. Your ~/htdocs directory serves documents.

    cd /home/folder/mine
    gzip -.d svnb-001.003.tar.gz
    tar -vxf svnb-001.003.tar
    mv svnb-001.003/cgi-bin/svnb.pl cgi-bin/
    mv svnb-001.003/htdocs/svnb htdocs/

Maybe you do not have a ~/perl directory. Here, this directory serves Perl modules and handlers.

    mkdir perl
    mv svnb-001.003/perl/* perl/

Text::Template - required Perl modules

[ svnb ] requires Text::Template This is not part of the standard Perl distribution. Hence, you need to install it. Follow these instructions to install it.

  1. Download Texdt::Template from CPAN
  2. Create and install it in your Perl module directory
  3.         gzip -d Text-Template-1.44.tar.gz
            tar -xcvf Text-Template-1.44.tar
            cd Text-Template-1.44
            perl Makefile.PL PREFIX=/home/folder/mine/perl
            make test
            make install

Read the release notes under svnb-001.003/relNotes.txt if you want.

svnb.pl - modify your access layer

Adopt the access layer. You execute CGI script. Hence, you just use the object representing the response handler in a mod_perl environment. The svnb.pl script residing in your cgi-bin directory is the access layer. Check that this layer uses all required modules. There must be the path to the /perl directory. Remember Text::Teamplate? You need your script use your site's perl library directory. to:

Just say

    use lib "/home/folder/mine/perl";
    use lib "/home/folder/mine/perl/lib/perl5/site_perl/5.8.3/";

at the top of the script (or where ever if you want). Then, the script knows to use the handler module.

Finally, change the shebang line of svnb.pl. If Perl resides in /usr/bin/, then the complete script look something like this:


    use lib "/home/folder/mine/perl";
    use lib "/home/folder/mine/perl/lib/perl5/site_perl/5.8.3/";
    use Svnb::Browser;

    Svnb::Browser -> handler();

Svn.pm - change the settings of your svn presentation

Not done, yet. Next, you need to change the specific settings for your environment. There is no configuration file. The settings are included at the top of the Svnb::Svn.pm object module inside ~/perl/Svnb/.

    my %SETTING = (
        DEBUG           => 0,
        SVN             => 'svn',
        REPOSITORY      => 'file:///home/folder/mine/svn-repos',
        CACHE           => 3 * 60,
        TEMPLATE        => '/home/folder/mine/htdocs/svnb/template',
        EMPTY_ICON      => '/svnb/icon/empty.gif',
        DIR_ICON        => '/svnb/icon/folderBlue.gif',
        FILE_ICON       => '/svnb/icon/generic.gif',
        HISTORY_ICON    => '/svnb/icon/history.gif',
        CSS_FILE        => '/svnb/template/svnb.css',
        JAVASCRIPT_FILE => '/svnb/javascript/svnb.js',
        MESSAGE_LENGTH  => 60,
        HELP_PAGE       => '/svnb/help',
        HELP_SUFFIX     => '.html',

Test execution

Run the cgi script with perl -c svnb.pl. No errors?

svn-repos - create a Subversion repository

Check your svn repository. Or do you have one, yet? Create a fresh directory and initialize the first repository. Here, we use a FSFS file-based type repository. I prefer Berkeley DB. But don't mind.

    mkdir svn-repos
    svnadmin create --fs-type fsfs svn-repos/svnb

Download a dump file if you need a testing repository. The [ svnb ] sources are available as a svn repository dump file.

    gzip -d svnb-svn.001.dump.gz
    svnadmin load svn-repos/svnb < svnb-svn.001.dump

You can verify and list the repository if you want:

    svnadmin verify svn-repos/svnb/
    svn -R list file:///home/folder/mine/svn-repos/svnTest/


Change permissions and clean up to your needs:

    chmod -R 755 htdocs/*
    chmod -R 755 cgi-bin/*.pl

    rm svnb-001.003.tar
    rm -Rf svnb-001.003

    rm Text-Template-1.44.tar
    rm -Rf Text-Template-1.44

    rm svnb-svn.001.dump

Configuration as a mod_perl handler

To install [ svnb ] as a mod_perl handler you need to add /home/folder/mine/perl to the @INC search list. You do this usually with the use lib bla bla statement in your Apache start up file:

    use lib /home/folder/mine/perl

This allows Apache to find Svnb::Browser when analyzing the following httpd.conf section:

    PerlModule Svnb::Browser
    <Location /sb>
        SetHandler perl-script
        PerlHandler Svnb::Browser

With this configuration you can locate your browser to http://yourServerDotNet/sb/svnb/ and see the [ svnb ]repository.

[ svnb ] © 2005 by Michael Rau [ svnb ]