User Tools

Site Tools


This page is in the 'old' namespace, and was imported from our previous wiki. We recommend checking for more up-to-date information using the search box.

Installing Greenstone2 from Source for Beginners

Instructions valid for 2.80.

This is more like a worked example of an installation. It gives a long, extended explanation with extra hand-holding, for people who want all the steps inbetween.

Some specifics on what it does and does not cover:

  • Installation from source on Linux only
  • It assumes you have the correct C/C++ compiler installed

This document may therefore particularly help people new to the University of Waikato's DL lab, as they're working on Linux and will probably be using the correct compiler by default.

Greenstone 2 will be referred to as GS2. And $ is an xterm prompt.

Where to get the source to install from

You have two options,

  1. You can get the source code from the downloaded Binary distribution for Unix/Linux.
  2. You can download the Source Distribution for GS2

Unix/Linux distribution (Binaries)

<blockquote>"To install this distribution, extract the gzipped tar archive and run the setupLinux.bin Java-based Installer program."</blockquote> For instance, if the downloaded tarzip is called gsdl-2.80-unix.tar.gz:

$ tar -xvzf gsdl-2.80-unix.tar.gz

Go into the new folder created (e.g. gsdl-2.80-unix) and ls to see that setupLinux.bin is there. Then run it:

$ cd gsdl-2.80-unix
$ ./setupLinux.bin
  • That will start the GS2 installation wizard (InstallShield):
  • Make sure to choose Custom setup.
  • Tick everything in Custom setup, including source code - because this is what we want.
  • I am assuming that your installation directory is called gsdl (this is the usual case) but perhaps you've installed it elsewhere. Your installation directory will be referred to in the rest of this article as $GSDLHOME.
  • Go into $GSDLHOME and look for the folders src and indexers. Folder src should now be there as we chose to install the source code. But depending on your GS2 Unix/Linux distribution version, folder indexers may be missing. If so, you'll need to download the Source distribution as explained in the section below and follow the steps from there onwards (or you can move the indexers folder from the extracted Source distribution and put it into $GSDLHOME and skip onto the section Compiling the Source).

Source distribution

For instance, I tried the source distribution for GS2 version 2.80

  • Untar it to extract:
$ tar -xvzf gsdl-2.80-src.tar.gz

The indexers folder should now be there in the extracted gsdl folder. Folder gsdl will be referred to as $GSDLHOME from now on.

Compiling the Source

This assumes your compiler is compatible, for further details on this matter, see Installing Greenstone.

Also make sure that JAVA_HOME is set. On Macintosh machines Java tends to come installed these days (Mac OS Leopard) and is usually located at


For a MAC, if your source code was from SVN, gdbm (Gnu Database Manager) will not be included and you will need to get it. You can download this from here.

For Macs: Installing GDBM

  • Open a console window and decompress the gdbdm tar file:
> tar -xvzf gdbm-<version>.tar.gz
  • Compile it with the prefix set to the parent directory of the unzipped gdbm folder. For instance, if you unzipped gdbm into $GSDLHOME, then your gdbm folder would be located in $GSDLHOME. Move into the gdbm folder and compile it with
> ./configure --prefix=/path/to/parentfolder/of/gdbmfolder

> make

The make install step is different in that you need to provide your user and group names:

> make BINOWN=your-user-name BINGRP=your-group-name install

To find out what group(s) you belong to, type the following in an x-term:

> groups

Compiling Greenstone 2

  • If you're on Linux, go to the $GSDLHOME folder and type
$ ./configure
$ make
$ make install

If it complains about gdbm or usr/local while compiling, then you need to find the path to gdbm first (assuming you're still in $GSDLHOME):

$ find . -name "gdbm"

Hopefully this will find the location of gdbm for you and you can use this path in the configuration and make again, as shown below. If you're on a Mac OS, you would similarly need to provide the location of gdbm's folder when compiling it up as follows. (If that doesn't work, then try specifying the parent folder of the gdbm folder instead.)

$ ./configure --with-gdbm=/full/path/to/parentfolder/of/gdbmfolder
$ make
$ make install

If you still have difficulties compiling, looking at the Compiling Greenstone Advanced page may help you.

  • Still in $GSDLHOME, set up the environment for GSDLHOME:
$ source setup.bash
  • Now you're set up. To view the Greenstone pages in your web server, you need to do the following:

In your apache web server httpd.conf file, add the following (unless you already added it), making sure to adjust the 4 occurrences of $GSDLHOME below to its full path:

#Greenstone 2 script:
  ScriptAlias /greenstone/cgi-bin "$GSDLHOME/cgi-bin"
  <Directory "$GSDLHOME/cgi-bin">
     Options None
     AllowOverride None
  Alias /greenstone "$GSDLHOME/"
  <Directory "$GSDLHOME/">
     Options Indexes MultiViews FollowSymLinks
     AllowOverride None
     Order allow,deny
     Allow from all

NOTE: You can choose a prefix for the alias other than greenstone–for example, gs2remote–as long as whatever you chose is what you will use below.

  • In the file $GSDLHOME/cgi-bin/gsdlsite.cfg,
  • Change:
gsdlhome    **GSDLHOME**

to the full path of $GSDLHOME (you can put it in quotes, try this especially if your path contains spaces):

gsdlhome    "/full/path/"
  • In Greenstone versions GS2.81 and older, you will need to uncomment the line: #httpprefix /gsdl

to get:

httpprefix  /sdl

And you'll need to adjust: "httpimg /images" to (In both cases, make sure that the prefix is the same as the alias registered with your web server.)

httpimg     /gsdl/images
  • Make sure your webserver is running and open your browser at:

Or, if installed locally, try:

  • Now you need to compile the Greenstone Librarian Interface, GLI. So go into the gli folder in $GSDLHOME and run to compile:
$ cd gli
$ ./
  • To run the GLI application:
$ ./
  • Once it has started up for the first time, a dialog box pops up asking for you to "Enter value".

It wants the Greenstone browser url (see Setting up an Apache Web Server for Greenstone 2 Walkthrough):


where gsdl/cgi-bin is the Alias specified in your Apache web server installation's configuration file - /path/to/apache-webserver-installation-folder/conf/httpd.conf.


  • When on Ubuntu, if the compilation of wget fails with a message saying that msgfmt could not be found (followed by a listing of compile Error messages for wget), then you need to install msgfmt. In order to find out how you can install msgfmt, open a new xterm and type

It will hopefully tell you that you need to install this package first and tell you how to do it. If you have admin rights, you can follow the instructions that it provides to install msgmft. Once installed, execute the make command again and hopefully GS2 compilation will complete successfully now.

old/installing_greenstone_2_from_source_for_beginners.txt · Last modified: 2023/03/13 01:46 by