greenstone.org greenstone wiki greenstone trac planet greenstone

Installing Greenstone 2 from source for Beginners

From GreenstoneWiki

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.


Contents

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)

  1. Download the distribution from Unix/Linux distribution from http://www.greenstone.org/download
  2. Download the Installer's Guide, Install-en.pdf also off http://www.greenstone.org/
  3. The Download Greenstone page states:
    "To install this distribution, extract the gzipped tar archive and run the setupLinux.bin Java-based Installer program."

    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
  4. 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.
  5. 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.
  6. 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

  1. Download the Source Distribution from http://www.greenstone.org/download. For instance, I tried the source distribution for GS2 version 2.80
  2. 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.

  1. Now, go to the $GSDLHOME folder and type
    $ ./configure
    $ make all
    $ 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:

    $ ./configure --with-gdbm=/full/path/to/your/gdbm/directory
    $ make
    $ make install
    

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

  2. Still in $GSDLHOME, set up the environment for GSDLHOME:
    $ source setup.bash
  3. Now you're set up. To view the Greenstone pages in your web server, you need to do the following:
    1. You need set up your web server to work with GS2. Setting up an Apache Web Server for Greenstone 2 Walkthrough is a walkthrough that may help you if you haven't done this step yet. 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 /gsdl/cgi-bin "$GSDLHOME/cgi-bin"
        <Directory "$GSDLHOME/cgi-bin">
           Options None
           AllowOverride None
        </Directory>
        
        Alias /gsdl "$GSDLHOME/"
        <Directory "$GSDLHOME/">
           Options Indexes MultiViews FollowSymLinks
           AllowOverride None
           Order allow,deny
           Allow from all
        </Directory>
      
    2. in the file $GSDLHOME/cgi-bin/gsdlsite.cfg,
      • Change:
      gsdlhome    **GSDLHOME**

      To the full path of $GSDLHOME, in quotes:

      gsdlhome    "/full/path/"
      • Uncomment: #httpprefix /gsdl
      httpprefix  /gsdl
      • And adjust: "httpimg /images" to
      httpimg     /gsdl/images
    3. Open your browser at:
      http://WebServerName:WebServerPort/gsdl/cgi-bin/library

      Or, if installed locally, try:

      http://localhost:WebServerPort/gsdl/cgi-bin/library

  4. Now you need to compile the Greenstone Librarian Interface, GLI. So go into the gli folder in $GSDLHOME and run makegli.sh to compile:
    $ cd gli
    $ ./makegli.sh
  5. To run the GLI application:
    $ ./gli.sh
  6. 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):
    http://WebServerName:WebServerPortnumber/gsdl/cgi-bin/library
    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.