====== Source Installation on Linux - Greenstone2 ======
NB: These instructions will apply from 7th June 2007
* [[http://mikesopensourcestuff.blogspot.co.nz/2009/06/step-by-step-installing-greenstone-282.html|Step By Step Installing Greenstone 2.82 on Ubuntu 8.10 (Quickstart)]]
===== Getting Greenstone2 running under linux, using SVN and Apache =====
My sample user is ''xxx'' - substitute your username for ''xxx'' in the following instructions.
==== 1. Get Greenstone from SVN ====
We generally advise people to install greenstone on the research partition of your computer - some people have had problems installing in their home directory. But you can try in your home directory if you like. Assuming you will use the research partition:
mkdir /Scratch/xxx (create a place for your research files if you haven't already)
cd /Scratch/xxx
svn co http://svn.greenstone.org/gsdl/trunk gsdl
Change to the ''gsdl'' directory and check out the indexers:
cd gsdl
svn co http://svn.greenstone.org/indexers/trunk indexers
Still in the ''gsdl'' directory, compile the code:
./configure
make
make install
Now greenstone is installed in ''/Scratch/xxx/gsdl''
==== 2. If you want to use the GLI ====
In the ''gsdl'' directory, run:
svn co http://svn.greenstone.org/gli/trunk gli
cd gli
./makegli.sh
To start the GLI, in the ''gli'' directory run:
./gli.sh
==== 3. Install Apache ====
You will need to install Apache to be able to run the cgi executable.
Download a recent Apache2 binary from [[http://httpd.apache.org/download.cgi|http://httpd.apache.org/download.cgi]]
(Apache1.3 will also work, but Apache2 is much better.)
Unpack the tar file:
cd /Scratch/xxx
tar -xzf apache_2.x.x.tar.gz
Compile the source:
cd apache_2.x.x
./configure --prefix=/Scratch/xxx/httpd
make
make install
Now apache is installed in ''/Scratch/xxx/httpd''
To start and stop apache, type
/Scratch/xxx/httpd/bin/apachectl start
/Scratch/xxx/httpd/bin/apachectl stop
To change the port that apache runs on, edit the ''/Scratch/xxx/conf/httpd.conf'' file and
change the Port or Listen directive to the correct port - ''8080'' is a good choice.
After restarting apache you will then be able to access your apache installation at
[[http://localhost:8080/|http://localhost:8080/]].
==== 4. Tell apache about greenstone ====
The basic method for making a greenstone installation available through a web server is to
* Make the contents of the gsdl home folder visible on the web by placing them (or a symbolic link to them) somewhere within the htdocs folder of your apache installation.
* Make some or all of the contents of the gsdl/cgi-bin folder available for execution on your apache server by placing a them (or a symbolic link to them) into the cgi-bin folder of your apache installation. (Make sure you include at least the 'library' or 'library.exe' executable.)
* Create/edit the ''gsdlsite.cfg'' file inside the cgi-bin folder of apache, as a sibling of the 'library' or 'library.exe' executable.
This is the way I used:
cd /Scratch/xxx/httpd/cgi-bin
ln -s /Scratch/xxx/httpd/gsdl
ln -s /Scratch/xxx/gsdl/cgi-bin/library
cp /Scratch/xxx/gsdl/cgi-bin/gsdlsite.cfg .
cd /Scratch/xxx/htdocs
ln -s /Scratch/xxx/gsdl
You may need to edit the ''gsdlsite.cfg'' file.
Make sure the following are uncommented and set like this:
gsdlhome /Scratch/xxx/gsdl
httpprefix /gsdl
httpimg /gsdl/images
Now you need to edit apaches config file ''/Scratch/xxx/httpd/conf/httpd.conf''
In the '''' bit, change 'Options None' to 'Options
FollowSymlinks'
After editing the ''httpd.conf'' file, you will need to restart apache for the changes
to take effect.
You should now be able to access your greenstone installation at
''http://localhost:8080/cgi-bin/library''
===== Updating your installation =====
//Contributed by Julian Fox to the Greenstone mailing list.//
There is nothing particularly difficult about an upgrade on Linux, except that you may need to keep a close eye on several of the factors indicated below. Here is one person's experience of upgrading (successfully!) from 2.73 to 2.80, not with a view to running two or more GS's on the server however - just the most recent version.
1. Initially, 2.73 had been installed at usr/local/gsdl. In retrospect it would have been better to have created a usr/local/greenstone/2.73, then let the installation create its gsdl folder there. It's just neater, that's all, and ensures the preservation of whatever has been customised. So this time I created usr/local/greenstone/2.80 (you could also just create usr/local/2.80, up to you) and having downloaded and unpacked the gsdl-2.80-unix file, then began the installation process. For anyone relatively new to working with Linux, it's worth noting that you find the Install script (Install.sh) in the Unix folder, and that you need to change its permission to make it executable, usually simply done by right clicking it and then checking the 'execute' spot under properties-permissions. Then you simply run ./Install.sh from that Unix folder and it gets on with the job!
2. The installation process asks questions throughout. Most of them have obvious answers. It's a good idea to have checked one's Apache setup earlier in order to have the right responses to questions relevant to that. Clearly, one obvious change given the creation of the usr/local/greenstone folder above was that Apache would now have to point to a different location; the /gsdl alias needs altering. I will not deal with the Apache changes here - that can be followed separately from existing documentation, just by making
relevant changes. I'll just note that I let the installation use the cgi-bin folder in the new gsdl installation rather than the Apache one. It's one of the questions you are asked. I had a systems administrator nearby, so any dealings with Apache had his advice behind it!
3. There was sufficient space on the disk to actually copy all collections (a whopping 30Gbs worth) across to the new 'collect' folder created in the installation process under the new gsdl folder in 2.80. I moved each one individually and checked it but my observation was that this part could hardly go wrong - just a simple copying of the collections from 2.73 to 2.80 involved no dramatic changes.
4. The really important part of the upgrade however is to ensure that you move across all other relevant files. To be sure, I changed certain existing new files concerned (main.cfg, users.db, key.db, history.db, all to be found in /etc, and any *dm files I had altered, including the style.dm, along with new images I had added in the /images folder, and style.css there too, since I had altered that ) all to *.old or something like that, and simply transferred all my existing files from the older installation to
their appropriate folders. I wasn't sure if there had been any change to the way macro files worked, so that's why I played safe, so I could return to the 'proper' 2.80 macros or *.cfg files if necessary and then make relevant changes afterwards. But in fact, simply replacing the older files, at least for this upgrade, would have made no difference. Everything worked.
To update your gsdl installation, or gli, do an ''svn update'' in the appropriate
directory and then recompile the source code. For example, to update the main gsdl
installation, run:
cd /Scratch/xxx/gsdl
svn update
make clean
./configure
make
make install
===== Less Complex Explanation =====
Compile up gnome-lib yourself and compile up GS:
1. svn co http://svn.greenstone.org/main/trunk/greenstone2
2. cd greenstone2
svn co http://svn.greenstone.org/main/trunk/gli
cd /back/to/greenstone2
3. ./makegs2.sh gnome-lib
This will check out the gnome-lib src code and then
---
Get a gnome-lib binary for your OS and compile up GS:
1. svn co http://svn.greenstone.org/main/trunk/greenstone2
2. cd greenstone2
svn co http://svn.greenstone.org/main/trunk/gli
cd /back/to/greenstone2
3. check out gnome-lib minimal for your OS from
http://trac.greenstone.org/browser/gs2-extensions/gnome-lib/trunk
into your greenstone2-home/ext
4. cd ext/gnome-lib-src
./CASCADE-MAKE.sh
source devel.bash
cd /back/to/greenstone2-home
5. ./configure --enable-apache-httpd
6. make
5. make install