Mozilla Webtools HOWTO

How to install LXR, Bonsai, and Tinderbox

Gregory Michael Leblanc

Abstract

This document will attempt to detail the steps needed to install LXR, Bonsai, and Tinderbox. I wrote these up after needing to configure these tools for the GNOME Project.


Table of Contents

LXR
Getting LXR
Setting up lxr.conf
LXR/Apache Configuration
Generating the On-Disk Indexes
Bonsai
Getting Bonsai
Installing bonsai

LXR

LXR comes with an install file that talks a bit about how to set things up. Make sure that you've read that first, as it's somewhere to start.

Getting LXR

The first step is to get LXR from mozilla CVS. Mozilla has some complete instructions, but here's an abbreviated version.

Procedure 1.

  1. Set your CVSROOT variable to :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot. Run cvs login, and leave the password blank.

  2. Run cvs -z3 checkout mozilla/webtools/lxr.

  3. Now you'll want to move the lxr/ directory to somewhere that your webserver can access it. This is usually someplace like /var/www/html/.

  4. Note

    This step is only necessary if you're using LXR to cross-reference a single source tree. If you have multiple trees, you can skip this step. As of October 25, 2001, this step is still required. I'll try to let everybody know as soon as this changes.

    Visit Bug 41917 and download the third patch. Without this patch, you'll spend a lot of time beating your head against the wall trying to figure out what's going wrong.

TADA! Now you've got the LXR files in place, and are ready to set things up for your local install.

Setting up lxr.conf

In order for LXR to know where you've put things, you have to set up the lxr.conf file. Most of these parameters are documented in INSTALL, but we'll go over them again here.

baseurl

This is the ‘root’ of the LXR web tree. For us, this was ‘http://cvs.gnome.org/lxr/’.

bonsaihome

This is like the baseurl, except that it's for bonsai instead. Ours was ‘http://cvs.gnome.org/bonsai’.

htmlhead, htmltail, htmldir, sourcehead, sourcedirhead

These are all templates. Open up the examples, and play around with them so that LXR matches the rest of your website nicely. These are all very mozilla specific, so be sure to go over them a couple of times.

sourceroot

There are two possible ways to specify sourceroot. If you're only cross-referencing a single tree, use use

sourceroot: /cvsroot/gnome
where /cvsroot/gnome is the location of the checked out sources that you want to cross-reference.

If you're cross-referencing multiple trees, you'll need to use the second format.

sourceroot: gnome
      /cvsroot/gnome/tree1
sourceroot: othertree /cvsroot/gnome/othertree
See lxr.conf for more details.

sourcerootname

This is a name for the project that you're cross-referencing.

virtroot

This parameter is a little trixy. Supposedly this is prepended to the URL, but the behaviour seems to vary depending on whether or not there is a leading /. For our setup, I found that /lxr was the right thing to use.

incprefix

This is the prefix to map things like

#include <foo.h>
to. I left it set to /include.

dbdir

This is where lxr will store the database files that it creates. I put them in lxr/data, mirroring the bonsai configuration. You could easily put them most anywhere.

glimpsebin

Make this the path to wherever you've installed glimpse.

Note

Glimpse isn't truly free. You can get it, and some details on the license that it falls under from http://webglimpse.org/.

LXR/Apache Configuration

Like any other web application, you have to tell your web server how to handle lxr. The INSTALL file talks about these changes, but I wanted to augment this a little bit.

srm.conf

srm.conf needs to have a line to handle cgi-scripts. It should look something like

AddHander cgi-script .cgi
Look around, it make be as simple as un-commenting this line.

access.conf

You'll want to add a section here for the directory where you've installed LXR. It needs to have at least

Options ExecCGI FileInfo
AllowOverride Options

You'll have to make sure that your dbdir is readable by the user that the webserver runs as.

Generating the On-Disk Indexes

Before LXR can do anything useful, you have to create the on disk indexes for it. This is really straightforward.

Identifier Database. cd to the directory you specified as the dbdir in lxr.conf and run /var/www/html/lxr/genxref /cvsroot/gnome where /cvs/gnomeis the location to the source code that you want to browse with LXR.

Glimpse Database. Go to the same directory as you did for the indentifier database, but this time run /path/to/glimpse -H . /cvs/gnome, where /cvs/gnome is the path to the sources you want to be able to search.