Re: [greenstone-users] Lucene

From Katherine Don
DateThu, 05 Oct 2006 15:39:00 +1300
Subject Re: [greenstone-users] Lucene
In-Reply-To (45245A0B-3000405-cs-waikato-ac-nz)
Hi James

You need to set JAVA_HOME in your apache httpd.conf file,

E.g.

<IfModule mod_setenvif.c>
SetEnv JAVA_HOME /var/lib/jdk1.4.2/
</IfModule>

The lucene_query.pl file then needs to be set up to use JAVA_HOME.

Add in
sub get_java_path()
{
# Check the JAVA_HOME environment variable first
if (defined $ENV{'JAVA_HOME'}) {
my $java_home = $ENV{'JAVA_HOME'};
$java_home =~ s//$//; # Remove trailing slash if present (Unix
specific)
return &util::filename_cat($java_home, "bin", "java");
}

# Hope that Java is on the PATH
return "java";
}

then, where it calls java, do
my $java = &get_java_path();
and use '$java' instead of 'java'.

This will be in the new release.

Cheers,
Katherine

Michael Dewsnip wrote:
> Hi James,
>
> Good to hear you've got it working.
>
> Yes, there is some environment variable setting in the Apache config
> file that you can set, but I can't remember what it is exactly -- you
> might have to check the documentation. I just make sure I have Java on
> my PATH before starting up the webserver, and it should inherit the
> environment settings.
>
> Regards,
>
> Michael
>
>
>
> James Brunskill wrote:
>
>
>>Hi Michael,
>>
>>Thanks for you help. I actually figured it our just before you
>>emailed...
>>
>>
>>[root@liby-travis greenstone]# tail /var/log/httpd/error_log
>>[Thu Oct 05 13:36:06 2006] [error] [client 130.217.128.233] sh: line 1:
>>java: command not found, referer:
>>http://liby-travis/gsdl/cgi-bin/library?a=q&r=1&hs=1&e=q-000-00---0lucen
>>ete--00-2-0--0prompt-10-TX--4------0-1l--1-en-50---20-about-law--00011-0
>>01-0-0utfZz-8-00&fqf=TX&t=0&q=law
>>
>>For some reason the path to java wasn't set for the webserver. I got
>>around it by putting the full path into lucene_query.pl What is the
>>correct way to set this? I guess I need to set the PATH env for the
>>webserver somehow?
>>
>>Regards,
>>
>>James Brunskill
>>Library Systems Consultant
>>The University of Waikato
>>Ph: +64 7 838 4323
>>
>>
>>
>>
>>>-----Original Message-----
>>>From: Michael Dewsnip [mailto:mdewsnip@cs.waikato.ac.nz]
>>>Sent: Thursday, 5 October 2006 1:42 p.m.
>>>To: James Brunskill
>>>Cc: greenstone-users@list.scms.waikato.ac.nz
>>>Subject: Re: [greenstone-users] Lucene
>>>
>>>Hi James,
>>>
>>>The history.db error is a red herring actually, and isn't related to
>>>Lucene searching. If you make this file writeable by everyone then the
>>>error will go away.
>>>
>>>Back to Lucene, you should check that the
>>>/opt/greenstone/bin/script/lucene_query.pl file has execute
>>>
>>>
>>
>>permissions
>>
>>
>>
>>>for everyone: chmod a+x lucene_query.pl.
>>>
>>>Regards,
>>>
>>>Michael
>>>
>>>
>>>
>>>James Brunskill wrote:
>>>
>>>
>>>
>>>
>>>>Hi Michael,
>>>>
>>>>Good thinking with permissions on error.txt. I recreated that file so
>>>>that I could filter out all the old junk (of course the permissions
>>>>
>>>>
>>
>>were
>>
>>
>>
>>>>wrong)
>>>>
>>>>**** in lucene search
>>>>**** query string = TX:(+law)
>>>>**** escaped query string = TX:(+law)
>>>>***** index name = /opt/greenstone/collect/lucenete/index/didx
>>>>Lucene command: "/opt/greenstone/bin/script/lucene_query.pl"
>>>>"/opt/greenstone/collect/lucenete/index/didx" "TX:(+law)"
>>>>**** xml_text =
>>>>database open failed on: /opt/greenstone/etc/history.db
>>>>
>>>>history.db seems to be 0 bytes. The lucene_query.pl command works
>>>>
>>>>
>>
>>fine
>>
>>
>>
>>>>from the commandline, so I guess it must be something to do with the
>>>
>>>
>>>
>>>>history.db
>>>>
>>>>Regards,
>>>>
>>>>James Brunskill
>>>>Library Systems Consultant
>>>>The University of Waikato
>>>>Ph: +64 7 838 4323
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: Michael Dewsnip [mailto:mdewsnip@cs.waikato.ac.nz]
>>>>>Sent: Thursday, 5 October 2006 1:02 p.m.
>>>>>To: James Brunskill
>>>>>Cc: greenstone-users@list.scms.waikato.ac.nz
>>>>>Subject: Re: [greenstone-users] Lucene
>>>>>
>>>>>Hi James,
>>>>>
>>>>>You'll need to make sure the error.txt file is writeable by all, ie.
>>>>>
>>>>> chmod a+w error.txt
>>>>>
>>>>>You should also look in your webserver error log.
>>>>>
>>>>>Greenstone's support for Lucene has improved dramatically recently;
>>>>>these changes will be in Greenstone v2.71 (any day now).
>>>>>
>>>>>Regards,
>>>>>
>>>>>Michael
>>>>>
>>>>>
>>>>>
>>>>>James Brunskill wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Hi,
>>>>>>
>>>>>>I have been trying to get the lucene indexer to work on a linux
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>machine,
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>gs version 2.70.
>>>>>>
>>>>>>The collection appears to build ok, and classifer navigation works
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>fine,
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>but all searches return no documents.
>>>>>>
>>>>>>Can any one point me in the right direction to track down what is
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>going
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>on? Nothing seems to be written to errors.txt
>>>>>>I'm not sure what other logs are available...
>>>>>>
>>>>>>Regards,
>>>>>>
>>>>>>James Brunskill
>>>>>>Library Systems Consultant
>>>>>>The University of Waikato
>>>>>>Ph: +64 7 838 4323
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>----------------------------------------------------------------------
>>>>
>>>>
>>
>>-
>>
>>
>>
>>>>>
>>>>>
>>>>
>>>>-
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>_______________________________________________
>>>>>>greenstone-users mailing list
>>>>>>greenstone-users@list.scms.waikato.ac.nz
>>>>>>https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>>
>>
>>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> greenstone-users mailing list
> greenstone-users@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users