Monday, September 28, 2009

Greenstone on the Mac and Linux

Since the new version of Greenstone now includes the remote GLI client, we are keen to test out a server install and to use the client to connect to a portable server, either linux or osx based.

First we download the .dmg from http://www.greenstone.org and extract and run the 2.82 installer. This installs to /Users/gnickers/Greenstone and we select the core, imagemagick and ghostscript. We also enable the Admin pages checkbox with the usual password.

Click Install and away it goes, completing in 42 seconds. In the Greenstone folder we find a bunch of directories:

apache-httpd - the web server
gli - the librarian interface for building collections
bin - executables
collect - collections
image - CSS files and images

The greenstone server interface (GSI) is an application to start/stop the local library server. On Linux and OSX it uses the apache web server that comes with Greenstone.

I see the gs2-server.sh file is there and on linux this requires a trip to the terminal and the ./gs2-server.sh command but it's been years since i did much in the cli in osx. We try it out in terminal and it works. However, port 80 is in use or can't be assigned. (apache already running?) so it assigned port 8282 and pops up a dialog box. We click Enter Library and the server control panel starts up in the web browser. However Safari returns 'can't connect to server'.

Curious to see if localhost is running we try port 80 but nothing. So what's using port 80? We don't have skype installed...

Ubuntu Install

So we try the linux version. The installer program runs just the same. We open a shell and cd Greenstone and type:

./gs2-server.sh

and get the same message about 'port 80 in use or can't be assigned'. We click Enter Library but get the same 'Failed to Connect to locahost:8282

Time for some research....

2 comments:

Chris Poirier said...

Hi Gord,

Don't know if you ever solved this problem. A friend had me look at her install, and the problem seems to be that the application launches Safari with an "http://localhost:8282/" address, but sets its access control rules to "127.0.0.1". The problem is that, on the Mac, "localhost" is mapped to "::1" as well as "127.0.0.1" in /etc/hosts, and the mismatch seems to be a problem.

Fortunately, while I was figuring this out, she found a simple solution. On the window that opens when you run the launch script, there's a File menu. Choose the Settings option and change the configuration to use "127.0.0.1" instead of "localhost" when launching Safari.

To be honest, I'm not sure I exactly understand the difference. My best guess is that Safari is opening an IPv6 socket if you use "localhost", and an IPv4 socket if you use "127.0.0.1", which might be why Apache is getting a different client IP, which causes the access rules to fail.

Chris.

Silverfish said...

I just downloaded Greenstone for my Mac and had the exact same problem, error messages, everything. However, in my case the fix of changing the configuration to "127.0.0.1" instead of "localhost" didn't change anything. Safari still can't connect to the server. Any further suggestions?

-Charlotte