Thursday, June 5, 2008

Greenstone on OSX



The idea is to test how the Greenstone digital library software works on version 10.5 of OSX as there were issues with greenstone the last time i tried it on osx some years ago.

Greenstone has two dependencies, you must have a java virtual machine installed as well as the open source imagemagick software. OSX comes with a JRE already installed, unlike windows where it has to be downloaded and installed by the user.

Next it is off to http://www.imagemagick.org to download the apple osx binary which has a version for tiger (10.4) and leopard (10.5). The 10.5 package is downloaded.

We then goto http://www.greenstone.org and on the downloads page get the osx binary.

Once the files are downloaded we created a folder called ImageMagick in the Applications directory and dragged the ImageMagick-univeral-apple-darwin9.3.0.tar.gz file to that folder.

Next we navigated to the Applications, Utilities folder and double-clicked on Terminal

At the gnickers$ prompt we issued the following commands (pressing Enter after each command):

cd Applications
cd ImageMagick
ls -al

You should see the file ImageMagick-universal-apple-darwin9.3.0.tar.gz

Now we type the command tar xvfz ImageMagick-universal-apple-darwin9.3.0.tar.gz and press enter. A whole bunch of files are extracted into a folder called ImageMagick-6.4.1

We then set the MAGICK_HOME variable to the folder by typing the following command:

export MAGICK_HOME="/Applications/ImageMagick/ImageMagick-6.4.1"

Then we set the path to include the bin directory holding the executable files:

export PATH="$MAGICK_HOME/bin:$PATH"

Then we set the download path with the following command:

export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"

Now comes the test to see if this actually works. We issue the following commands, pressing enter after each one:

convert logo: logo.gif
identify logo.gif
display logo.gif

Success, we see the ImageMagick logo open in a window. So now we can process images in greenstone which is the next task.

We return to the downloads and double click on gsdl-2.80-macOSx.tar which extracts the files from the archive into a folder called gsdl-2.80-macOSx. Inside the folder is an installer called setupMACOSx.command so we double click on it.

A warning message appears about his being a script that was downloaded from the Internet. We click on OPEN. Just like the windows installer it begins searching for a java virtual machine but unlike the windows version it actually finds it and the install begins.

We select a language, click Next, accept the license agreement and it installs to /opt/greenstone. There is a major difference here that with the windows version which has a local install that setup up a mini-web server that only responds to localhost requests. The OSX version is a web library version that requires the apache webserver. This is interesting as the machine i am installing on is running OSX 10.5 Server edition so all it already has a web server. However for users of the desktop version this is usually not the case.

However, there is an excellent MAMP package for osx at http://www.mamp.info which i have used before. This is a big step tho - would the average user wanting to run greenstone be also willing to install a full web server? It certainly would be interesting and also allow OAI harvesting...

There is also a Custom option. This seems to have the same settings that are the default on the windows version, the librarian interface, the web library, plus the export to CD/DVD and the demo collection.

We choose the Custom option and click Next, Next and then click Install. It does not look as if the custom option installs a web server. The file /opt/greenstone/library.txt indicates that greenstone is setup to expect /opt/greenstone to be at http://localhost/gsdl and the greenstone cgi directory at /opt/greenstone/cgi to be accessible as a cgi executable directory.

This means you must edit the apache webserver configuration file which is http.conf and add the following directives:

ScriptAlias /gsdl/cgi-bin"/opt/greenstone/cgi-bin"
Options None
AllowOverride None

Alias /gsdl "/opt/greenstone"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow.deny
Allow from all

Once this has been saved and the web server restarted you can then access Greenstone by pointing your web browser to:

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

Since we don't really intend to run greenstone on osx we will stop here. We might work at getting it installed on Ubuntu and will certainly have the students test out and document the web server install next term for the internet services course.




1 comment:

Brent Gulanowski said...

Every version of Mac OS X has included the Apache web server -- that's how Personal Web Sharing works. There is, however, no user-accessible configuration utility. The standard text-based files are all there, however. In either 10.5 or 10.6, they finally moved from Apache 1.2 to 2.

Have a look in /etc/apache2, or /etc/httpd, depending on your Mac OS X version.