Bazaar & Loggerhead on Ubuntu 10.04

In howto on May 22, 2010 by theoryl Tagged: , , , , , , , ,

A quick installation log of Bazaar 2.1.1 and Loggerhead 1.17 on Ubuntu Lucid Lynx 10.04. Bazaar is a tool for distributed Version Control System (VCS), which some also call it Source Code Management (SCM). Loggerhead is a web-based code browser for Bazaar repository (more info)

1. Install from Ubuntu repository:
$ sudo apt-get install bzr loggerhead

2. Setup Bazaar as you would or refer to their decent 5-minute tutorial

3. The documentation of Loggerhead does not exist online, but is found in /usr/share/doc/loggerhead. All that you need to do though is:
$ sudo cp /usr/share/doc/loggerhead/examples/serve-branches.conf.example /etc/serve-branches.conf
$ serve-branches /path/to/branch
(by default, the host is localhost, the port is 8080. If these are not your choice, simply include the arguments --host=USER_HOST --port=USER_PORT. Optionally you can set --prefix=USER_PREFIX too)

4. Now you should be able to browse your codes at http://localhost:port/ (or http://USER_HOST:USER_PORT/USER_PREFIX/ if you set these arguments earlier)

5. To hide branches from being displayed, add to ~/.bazaar/locations.conf under the branch’s section:
http_serve = False

However, setting up a daemon is a bit tricky. If you want to use the daemon, you have to do a few things listed in the documentation. I’ll enumerate them below.

(The following is only for setting up the daemon)
6. Download loggerheadd from Loggerhead launchpad page, or if you compile from source, the file is in the source directory. Move loggerheadd to /etc/init.d and make it executable
$ sudo mv loggerheadd /etc/init.d
$ chmod 755 loggerheadd

7. Change the following lines in loggerheadd:
< SUDO="sudo -H -u $LHUSER"
> SUDO=""

< SERVE_BRANCHES_CMD=serve-branches
> SERVE_BRANCHES_CMD=/usr/bin/serve-branches

< LOG_FOLDER=/var/log/loggerhead
> LOG_FOLDER=~/log/loggerhead

< BZRROOT=/bzrroot
> BZRROOT=/path/to/branch

8. To start (or stop or restart) the daemon
$ /etc/init.d/loggerheadd start
(or change start to stop or restart)

9. To make it auto-start
$ cd /etc/init.d
$ sudo update-rc.d loggerheadd defaults

It seems that Loggerhead will eventually be provided as a Bazaar plugin, at which point you can just do:
$ bzr serve --http
But I don’t know how to do that just yet.


One Response to “Bazaar & Loggerhead on Ubuntu 10.04”

  1. I started taking my first steps with Bazaar and Loggerhead (after some intense googling) today. Your post helped alot with the latter part, Loggerhead.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: