source: gs3-extensions/fedora/trunk/src/README@ 26435

Last change on this file since 26435 was 26435, checked in by ak19, 11 years ago

Added notes to the README on how to manually index a doc into GSearch.

File size: 30.1 KB
Line 
1********************************************************************************************************************
2 CONTENTS
3********************************************************************************************************************
4
5A. To install your GS3 Fedora extension from fedora3-gs3ext.tar.gz
6 Uninstalling Fedora
7
8B. How to manually build fedora collections
9 Deleting a Fedora GS3 collection
10
11C. The customisations that have been made for the extension
12
13D. How to manually set up Fedora 3.6.1 with Fedora GSearch 2.5 from scratch
14 Installing Fedora
15 Installing Fedora GSearch
16 Debugging
17 Manually indexing docs with GSearch
18
19
20Version:
21Greenstone 3.05
22Fedora 3.6.1
23Fedora GSearch 2.5
24
25Web services pages once installed (by default GS3 is set to use localhost:8383):
26http://localhost:8383/fedora/services
27http://localhost:8383/fedoragsearch/services
28
29-- ak19, 2012
30
31
32
33********************************************************************************************************************
34 A. To install your Fedora extension for Greenstone 3 from the fedora3-gs3ext.tar.gz distribution file
35********************************************************************************************************************
36
37(Tested to work on Linux machines.)
38
390. You will need Greenstone 3.05 or a fresh checkout from SVN, already installed.
40You need a fresh x-term, one where the GS3 environment hasn't already been set up in.
41
421. Download the Fedora Extension for Greenstone 3: http://trac.greenstone.org/browser/gs3-extensions/fedora/trunk/fedora3-gs3ext.tar.gz
43
442. Save into your Greenstone3/ext folder
45
463. Untar and decompress it:
47 $ tar -xvzf fedora3-gs3ext.tar.gz
48
49This will create a fedora3 folder in your Greenstone3/ext folder.
50
514. Go to your Greenstone3 toplevel folder and now finally set up the GS3 environment:
52 $ source gs3-setup.sh
53
54This will now also have set up the fedora extension environment, such as FEDORA_HOME, FEDORA_VERSION and a PATH variable adjusted for Fedora.
55
565. Open Greenstone3/build.properties and find the section:
57
58 ##These need to be uncommented if using Fedora and Fedora GSearch with Greenstone's tomcat
59 fedora.home=#${basedir}/ext/fedora3
60 #fedora.maxpermsize=-XX:MaxPermSize=128m
61 #fedora.password=pounamu
62 #index.writelock.timeout=10000
63
64Uncomment all these properties and change the value for the fedora password if necessary:
65
66 ##These need to be uncommented if using Fedora and Fedora GSearch with Greenstone's tomcat
67 fedora.home=${basedir}/ext/fedora3
68 fedora.maxpermsize=-XX:MaxPermSize=128m
69 fedora.password=pounamu
70 index.writelock.timeout=10000
71
726. Use a terminal to go into this folder:
73 $ cd Greenstone3/ext/fedora3
74
757. If you type `ant` in the x-term, it will print the Usage message which will display the list of commands available and the order in which to execute them for proper installation. It's a 5 step process (explained in detail further below):
76
77 $ ant -Dgsdl3.home=<type-full-path-to-your-gs3> start-fedora-install
78
79 $ ant start
80
81 $ ant -Dgsdl3src.home=<type-full-path-to-your-gs3> continue-fedora-install
82
83 $ ant stop
84
85 $ ant -Dgsdl3src.home=<type-full-path-to-your-gs3> finish-fedora-install
86
87
88That's it.
89Now you can start tomcat again and visit http://localhost:8383/fedora and http://localhost:8383/fedoragsearch/rest to check the pages display.
90
918. You can start creating Greenstone Fedora collections with FLI. Run FLI from the GS3 toplevel folder by typing:
92 $ ./gli/fli.sh
93
94
959. Once you've tested everything is working, you may want to set logging level of Fedora GSearch to log ERRORs rather than all DEBUG statements. See the Debugging section in this file.
96
97
98DETAILS ON STEP 7:
99a. From your Greenstone3/ext/fedora3 folder, run:
100 $ ant -Dgsdl3.home=<type-full-path-to-your-gs3> start-fedora-install
101
102This step prepares the fedora and gsearch war files for deployment (by customising template files) and moves them into Greenstone 3's tomcat.
103
104b. Start tomcat by going into your GS3 toplevel folder and running:
105 $ ant start
106
107This step gets Greenstone's tomcat to deploy the fedora and fedoragsearch war files.
108You may want to check your Greenstone library is working by visiting http://localhost:8383/greenstone3 in your browser
109
110c. Go back into Greenstone3/ext/fedora3 and run:
111 $ ant -Dgsdl3src.home=<type-full-path-to-your-gs3> continue-fedora-install
112
113This target configures fedora-gsearch now that it has been deployed. It runs a fedora-gsearch ant build file to customise properties files that are internal to fedora-gsearch.
114
115d. Stop tomcat by going back into your GS3 toplevel folder and running:
116 $ ant stop
117
118You may want to check java instances running tomcat have indeed stopped:
119 $ ps aux | grep tomcat
120
121You will need to kill the process if any tomcat is still running at this stage (this can happen if you accidentally start tomcat several times in succession without stopping it).
122 $ kill -9 <process-id>
123
124e. Now that tomcat has stopped, go back into Greenstone3/ext/fedora3 and run:
125 ant -Dgsdl3src.home=<Full-Path-To-GS3> finish-fedora-install
126
127This will clean up the extension's war files in tomcat/packages/webapps now that they have already been deployed. (Do not perform this final step when tomcat is still running, else your fedora extension webapps will become undeployed.)
128
129
130
131When installation is completed, there will be a fedora3 folder in Greenstone3/ext, which you should not delete, since the Fedora Digital objects will be stored here, and the FedoraGSearch index will be created here.
132
133Further, the Fedora extension installation process would have made tomcat deploy several webapps in packages/tomcat/webapps. The resulting folders are:
134- fedora
135- fedora-demo
136- fedoragsearch
137- fop
138- imagemanip
139- saxon
140
141(Note that the installation process will have removed the Fedora extension war files it put into packages/tomcat/webapps during installation.)
142
143
144
145*****************************************
146UNINSTALLING FEDORA
147*****************************************
148
1491. Make sure tomcat is stopped.
150
1512. Go to /GS3/ext/fedora3 and run:
152 ant uninstall-fedora
153
154The above will remove
155- the deployed webapps (fedora, fedoragsearch, fedora-demo, fop, imagemanip and saxon.war)
156- as well as the ext/fedora3 folder itself.
157
158
159
160********************************************************************************************************************
161 B. Manual building of fedora collections
162********************************************************************************************************************
163
164You can use FLI to create, build and preview Fedora collections using Greenstone.
165
166The same can be done manually by calling the g2f perl scripts from the command line.
167
1681. Fedora needs to be running, so ensure the Greenstone tomcat is running:
169 ant start
170
1712. Set up the GS3 environment:
172 source gs3-setup.bash
173
1743. Create a new collection with mkcol.pl.
175 mkcol.pl -site localsite <COLNAME>
176
177(Deprecated: mkcol.pl -gs3mode -collectdir /<GS3>/web/sites/localsite/collect <COLNAME>)
178
1794. Run import and build to ingest the new collection. Make sure to use the correct host and port, as specified in your /<GS3>/build.properties file.
180
181- First put the documents you want into the import directory of your new collection.
182
183- g2f-import.pl -hostname localhost -port 8383 -password pounamu -removeold -collectdir /<GS3>/web/sites/localsite/collect <COLNAME>
184(password may be optional at this stage, by include it for convenience)
185
186- g2f-buildcol.pl -hostname localhost -port 8383 -password pounamu -removeold -collectdir /<GS3>/web/sites/localsite/collect <COLNAME>
187
188
189NOTE: The buildcol step would have created an index folder in the new fedora collection folder with a buildConfig.xml file in it containing the following:
190
191<buildConfig>
192 <metadataList/>
193 <serviceRackList>
194 <serviceRack name="FedoraServiceProxy" />
195 </serviceRackList>
196</buildConfig>
197
198
1995. If building the GS3 demo collection as a fedora collection:
200
201- use FLI to transfer dls to dc metadata upon Gathering the documents.
202- then before building, turn on the description_tags in the HTMLPlugin.
203Or manually add to the etc/collectionConfig.xml of the demo collection:
204
205 <plugin name="HTMLPlugin">
206 <option name="-description_tags"/>
207 </plugin>
208
209
210IMPORTANT NOTE: Fedora GSearch for some reason doesn't like the images in the default GS3 demo collection and is unable to index the documents because of them.
211If using the default GS3 demo collection, all the images -- both png and jpg alike -- need to first be resaved as their respective file types.
212Use Imagemagick to resave the many pngs, by going into each document's subfolder of the import folder and running:
213 mogrify -format png *.png
214
215Also open each folder's jpg document cover image in GIMP and resave under the same name (at 100% quality).
216
2176. If you ran FLI, exit it. It should stop the Greenstone server.
218
219With fedora installed, it's always good to check that the java process that launched tomcat has indeed stopped:
220 ps aux | grep "tomcat"
221
222(Since things will fail if multiple instances of this same tomcat are running, kill any java processes that are referring to tomcat.)
223
224
2257. Restart the GS3 server.
226 ant start
227
2288. Alternatively, to activate the collection, first visit the web page
229http://<host>:<port>/greenstone3/library?a=s&sa=a&st=collection&sn=<COLNAME>
230
2319. Then visit the collection from the Greenstone collections page
232
233
234*****************************************
235DELETING A FEDORA GS3 COLLECTION
236*****************************************
237
238Deleting a fedora GS3 collection requires the collection's documents and the collection file to be purged from the Fedora repository and removed from the Fedora Gsearch index. (In the case of a normal GS3 collection, just the GS3 collection's directory will be deleted.) There's now a script to delete a Greenstone Fedora collection which will take care of these additional steps if you are manually managing your collections. (FLI calls this script when a collection is deleted from FLI.)
239
240
241Deleting a Fedora GS3 collection is accomplished with the following 2 steps:
242
2431. Run the g2f-deletecol.pl script over the collection to be deleted:
244 g2f-deletecol.pl -hostname localhost -port 8383 -password pounamu -collectdir /<GS3>/web/sites/localsite/collect <COLNAME>
245
246(Note: no -removeold flag, otherwise the command is similar to the g2f-import.pl and g2f-buildcol.pl scripts)
247
2482. Manually delete the Greenstone collection directory from the filesystem
249
250
251To run this manually,
252- first remove the pids from the GSearch index:
253/<GS3>/packages/tomcat/webapps/fedoragsearch/client>/<GS3>/packages/tomcat/webapps/fedoragsearch/client/runRESTClient.sh localhost:8383 updateIndex deletePID <DOC-PID e.g. greenstone:fedora1-HASH010313b14474bc72b296b15f>
254
255It will ask for the fedoragsearch username and password, which by default are fedoraAdmin and pounamu, respectively.
256
257- then purge the necessary documents (pids) from the fedora repository:
258/<GS3>/ext/fedora3/client/bin>./fedora-purge.sh localhost:8383 fedoraAdmin pounamu <DOC-PID e.g. greenstone:fedora1-HASHe14e36cba08bd41c663237> http "purging"
259
260- You can check it's all been deleted by visiting http://localhost:8383/fedora/search
261and searching for:
262
263greenstone:*
264or greenstone:<colname>*
265
266Visit http://localhost:8383/fedoragsearch/rest?operation=browseIndex
267and browse the PID field
268
269You can also visit http://localhost:8383/fedoragsearch/rest?operation=gfindObjects
270then you can search for a query term by prefixing the index field to it, e.g ds.fulltext:computers
271
272
273
274********************************************************************************************************************
275 C. The customisations that have been made for the extension
276********************************************************************************************************************
277
278This section is of use when Fedora or GSearch is updated or if you want to update the fedora3-gs3ext.tar.gz distribution file with further customisations.
279
280The first version of the Fedora extension for Greenstone uses Fedora 3.6.1 and the GSearch 2.5 (which goes with Fedora 3.6.1).
281
282Some template files were added to Fedora and Fedora Gsearch's distribution files in order to customise these for installing them within a Greenstone 3 installation. These files are committed to SVN (without directory structure) at http://trac.greenstone.org/browser/gs3-extensions/fedora/trunk/src/fedora-files and http://trac.greenstone.org/browser/gs3-extensions/fedora/trunk/src/fedoragsearch-files
283
284They can be edited there if and when necessary, but they would then need to be included in the extension's distribution file fedora3-gs3ext.tar.gz to update its own existing copies.
285
286That's because these template files are included in the Fedora Extension for GS3 (fedora3-gs3ext.tar.gz). The extension's build.xml modifies these template files when installing the Fedora Extension into Greenstone 3. The template files contain placeholder strings that get updated when ant targets are run over the build.xml file.
287
288
2891. The customisation files for Fedora 3.6.1 are:
290
291- ./install/install.properties.in
292- ./install/server.xml.in
293- ./server/config/spring/akubra-llstore.xml.in
294- ./server/config/spring/web/web.properties.in
295- ./server/config/fedora.fcfg.in
296- ./server/config/fedora-users.xml.in
297
298
299(The following also need to refer to the servername and custom Greenstone tomcat port
300- ./client/bin/fedora-ingest-demos.bat.in
301- ./client/bin/fedora-ingest-demos.sh.in)
302
303
304All these files get converted to filenames without the ".in" suffix upon installation, and placeholder strings in these template files get replaced. The replacements are on the strings
305- @GSDL3SRCHOME@
306- @FEDORA_HOME@ (set to gsdl3srchome/ext/fedora3)
307- @tomcatserver@
308- @tomcatport@
309- @tomcatshutdownport@
310- @fedorapassw@
311- @indexwritelocktimeout@
312
313Except for the first, which needs to be set when running the Fedora extension's ant targets, all the remaining ones can be specified in Greenstone 3's toplevel build.properties.
314
315
3162. The customisation files for Fedora GSearch 2.6 are located in the "adjust_war_files" subfolder of fedora3-gs3ext.tar.gz file. This custom folder contains the official unpacked fedoragsearch folder, but with the following customisation files:
317
318- adjust_war_files/fedoragsearch/WEB-INF/web.xml
319- adjust_war_files/fedoragsearch/FgsConfig/fgsconfig-basic.properties.in
320- adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/foxmlToLucene.xslt
321- adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/foxmlToLuceneGenerated.xslt
322- adjust_war_files/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/index.properties
323- adjust_war_files/fedoragsearch/client/runRESTClient.sh
324- adjust_war_files/fedoragsearch/client/runSOAPClient.sh
325- adjust_war_files/fedoragsearch/client/runSOAPClient.bat
326
327
328All these files will get copied into the same locations within <GS3>/packages/tomcat/webapps/fedoragsearch. The file fgsconfig-basic.properties.in will get copied as fgsconfig-basic.properties but with the previously-listed placeholder strings replaced.
329
330
3313. There's also the fedora.xml.in inside the "adjust_war_files" folder of the unpacked extension. This template file will be copied over as <GS3>/packages/tomcat/conf/Catalina/localhost/fedora.xml during the extension installation process, also with placeholder strings replaced.
332
333
334DETAILS TO STEP 2 (Fedora GSearch customisation files):
335
336a. The changes to web.xml are that the authorisation filters are commented out:
337
338<!--
339 <filter-mapping>
340 <filter-name>EnforceAuthnFilter</filter-name>
341 <servlet-name>AxisServlet</servlet-name>
342 </filter-mapping>
343 <filter-mapping>
344 <filter-name>EnforceAuthnFilter</filter-name>
345 <servlet-name>GenericSearchREST</servlet-name>
346 </filter-mapping>
347 <filter-mapping>
348 <filter-name>EnforceAuthnFilter</filter-name>
349 <url-pattern>/index.html</url-pattern>
350 </filter-mapping>
351 <filter-mapping>
352 <filter-name>EnforceAuthnFilter</filter-name>
353 <url-pattern>/rest</url-pattern>
354 </filter-mapping>
355-->
356
357
358b. The 3 client scripts runRESTClient.bat, runRESTClient.sh and runSOAPClient.sh have been modified to be runnable from any directory, as they will be called by GS3's g2f perl scripts.
359
360- The bash files have been made executable on extraction of the GS3 Fedora extension and the following has been added to the top of the files:
361
362 # Need to run this script from its own directory instead of whichever directory it may be called from
363 thisdir="`dirname \"$0\"`"
364 thisdir="`cd \"$thisdir\" && pwd`"
365 cd "$thisdir"
366
367
368- Additions to the bat scripts are at the top and bottom:
369
370 @echo off
371
372 ::pushd "%CD%"
373 set startdir=%CD%
374 CD /D "%~dp0"
375
376 ...
377
378 :: popd
379 cd "%startdir%"
380 set startdir=
381
382
383c. The changes to fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene's foxmlToLucene.xslt and foxmlToLuceneGenerated.xslt are identical. The following xslt has been added:
384
385- Add the following namespaces to the namespace declarations at the top:
386 xmlns:ex="http://www.greenstone.org/namespace/fake/ex"
387 xmlns:dls="http://www.greenstone.org/namespace/fake/dls"
388
389- Add custom indexing for EX and DLS datastreams below the comment on datastreams:
390
391 <!-- a datastream is fetched, if its mimetype
392 can be handled, the text becomes the value of the field.
393 This is the version using PDFBox,
394 below is the new version using Apache Tika. -->
395
396 <xsl:for-each select="foxml:datastream[starts-with(@ID,'EX')]/foxml:datastreamVersion[last()]/foxml:xmlContent/ex:ex/ex:metadata">
397 <IndexField index="TOKENIZED" store="YES" termVector="YES">
398 <xsl:attribute name="IFname">
399 <xsl:value-of select="concat('ex.', @name)"/>
400 </xsl:attribute>
401 <xsl:value-of select="text()"/>
402 </IndexField>
403 </xsl:for-each>
404
405 <xsl:for-each select="foxml:datastream[starts-with(@ID,'DLS')]/foxml:datastreamVersion[last()]/foxml:xmlContent/dls:dls/dls:metadata">
406 <IndexField index="TOKENIZED" store="YES" termVector="YES">
407 <xsl:attribute name="IFname">
408 <xsl:value-of select="concat('dls.', @name)"/>
409 </xsl:attribute>
410 <xsl:value-of select="text()"/>
411 </IndexField>
412 </xsl:for-each>
413
414- Near the end of the XSLT files, just after index for the "foxml.all.text" field, allow just the full text of the documents to be indexed by adding an index for the ds.fulltext field:
415
416 <IndexField IFname="ds.fulltext" index="TOKENIZED" store="YES" termVector="YES">
417 <xsl:for-each select="//foxml:datastream[@CONTROL_GROUP='M' or @CONTROL_GROUP='E' or @CONTROL_GROUP='R']">
418 <xsl:value-of select="exts:getDatastreamText($PID, $REPOSITORYNAME, @ID, $FEDORASOAP, $FEDORAUSER, $FEDORAPASS, $TRUSTSTOREPATH, $TRUSTSTOREPASS)"/>
419 <xsl:text> </xsl:text>
420 </xsl:for-each>
421 </IndexField>
422
423
424Further datastreams and metadata sets can be indexed by adding similar namespace declarations and xml elements to these 2 XSLT files.
425If the changes are not meant to apply for all Greenstone users, individual Greenstone users can add fields for indexing by making such changes to just the file fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene/foxmlToLuceneGenerated.xslt
426
427
428d. By default, Lucene's lock obtain timeout is set to 0 in its properties file, which is not acceptable for all but the smallest documents. The lock timeout can be customised in build.properties and by default is set to 10000 (or 1000), which can be adjusted before starting the Fedora extension installation process.
429
430The installation process will write out this property into GSearch's FgsConfig/FgsConfigIndexTemplate/Lucene/index.properties:
431 fgsindex.defaultWriteLockTimeout = 10000
432
433(Another relevant place to change it would be ./FgsConfig/configDemoOnLucene/fgsconfigFinal/index/FgsIndex/index.properties)
434
435When fedoragsearch then gets deployed, this value will be propagated into:
436 <GS3>/packages/tomcat/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex/index.properties
437
438
439
440********************************************************************************************************************
441 D. To manually set up Fedora with Fedora GSearch 2.5 from scratch
442********************************************************************************************************************
443
444When installing Fedora, you can choose to install it outside Greenstone, and also instruct it to use its own tomcat. However, in the following instructions, Fedora's installation location (FEDORA_HOME) is still taken to be /GS3/ext/fedora3, since it's assumed Fedora is be installed to use Greenstone's tomcat.
445
446The Fedora GSearch war file will need to be unpacked in the tomcat/webapps folder of whichever tomcat Fedora is using. In the following, this is still Greenstone's tomcat.
447
448In whichever location Fedora is installed, that's where Fedora will store its digital objects and their datastreams, and that's where Fedora GSearch will create its GSearch index.
449
450
451********************************
452INSTALLING FEDORA
453********************************
4541. Set FEDORA_HOME=/<GS3>/ext/fedora3 in .profile (emacs ~/.profile)
455source ~/.profile
456
4572. Run fedora installer:
458 java -jar fcrepo-installer-3.6.1.jar
459
460Install by specifying to use the existing tomcat (existingTomcat), and provide the Greenstone3 tomcat stop and start ports (usually 8383 and 8305).
461Then set the existingTomcat to the Greenstone3 one: /<GS3>/packages/tomcat
462Turn on messaging, as this is necessary for Fedora GSearch.
463
464- Installation options:
465
466custom
467FEDORA_HOME
468pwd: pounamu
469host: <full-tomcat.server-host-name>
470def server context: fedora
471default false for user authentication for APIA-A
472false for SSL availability
473existingTomcat
474path to tomcat: </full-path-to-GS3>/packages/tomcat
475tomcat listen port: 8383
476tomcat shutdown port:8305
477derby:included
478upstream HTTP authentication: (default) false
479FeSL AuthZ: (default) false
480XACML policy enforcement enabled: false
481Low Level Storage: (default) akubra-fs
482Resource Index: true
483Enable Messaging: true
484Messaging Provider URI: [default is vm:(broker:(tcp://localhost:61616))]
485Deploy local services and demos: (default) true
486
487
488- The Fedora installation options used are to be found (after installation) in fedora3/install/install.properties:
489
490#Install Options
491#Fri Sep 21 15:29:29 NZST 2012
492ri.enabled=true
493messaging.enabled=false
494apia.auth.required=false
495database.jdbcDriverClass=org.apache.derby.jdbc.EmbeddedDriver
496upstream.auth.enabled=false
497ssl.available=false
498database.jdbcURL=jdbc\:derby\:/<GS3>/ext/fedora3/derby/fedora3;create\=true
499database.password=fedoraAdmin
500database.username=fedoraAdmin
501fesl.authz.enabled=false
502tomcat.shutdown.port=8305
503deploy.local.services=true
504xacml.enabled=false
505tomcat.http.port=8383
506fedora.serverHost=<full-tomcat.server-host-name>
507database=included
508database.driver=included
509fedora.serverContext=fedora
510llstore.type=akubra-fs
511tomcat.home=/<GS3>/packages/tomcat
512fedora.home=/<GS3>/ext/fedora3
513install.type=custom
514servlet.engine=existingTomcat
515fedora.admin.pass=pounamu
516
517
518- If trying to turn a custom installation into one for distribution, you would need to modify the following 4 files by inserting placeholder strings where applicable for the tomcatserver name, tomcat listen port and shutdown port, fedorapassword, GSLD3SRCHOME and FEDORA_HOME:
519
520fedora3/install/install.properties
521fedora3/server/config/spring/akubra-llstore.xml
522fedora3/server/config/fedora.fcfg
523fedora3/server/config/fedora-users.xml
524
525Then you would rename these files with the suffix .in
526
527
5283. Just to confirm there are no differences between the server.xml fedora has generated for fedora, and the server.xml of GS3's tomcat, run a diff:
529
530 diff -w /<GS3>/packages/tomcat/conf/server.xml </GS3/ext/>fedora3/install/server.xml
531
5324. Copy the fedora war files from fedora3/install into packages/tomcat/webapps
533fedora.war, fedora-demo.war, fop.war, imagemanip.war, saxon.war
534
5355. Copy the jar files xalan.jar, serializer.jar (and xsltc.jar) from Greenstone3's web/WEB-INF/lib into Greenstone3's packages/tomcat/lib so that fedora has access to the xalan version of the TransformerFactoryImpl class.
536
537There's also a xalan.jar in /<GS3>/packages/tomcat/webapps/fop/WEB-INF/lib
538So this can be copied into /<GS3>/packages/tomcat/lib/. instead of the Greenstone version.
539
5406. Create the file /<GS3>/packages/tomcat/conf/Catalina/localhost/fedora.xml
541containing:
542
543<?xml version="1.0" encoding="UTF-8"?>
544<Context>
545 <Parameter name="fedora.home" value="/<GS3>/ext/fedora3" />
546</Context>
547
548
5497. Before running the Greenstone server, make a copy of the fedora3 folder. Because once you start up tomcat, and visit the fedora home page, it will create a lot of files customised to the location of the current installation.
550
5518. Visit http://localhost:8383/greenstone3 and
552 http://localhost:8383/fedora
553
554to confirm both work.
555
556
557********************************
558INSTALLING FEDORA GSEARCH
559********************************
5601. Download Fedora GSearch 2.5
561
5622. Stop tomcat. Copy the fedoragsearch.war files into /<GS3>/packages/tomcat/webapps
563
564If Fedora was not installed with messaging turned on, then turn it on in now /<GS3>/ext/fedora3/server/config/fedora.fcfg:
565
566 <module role="org.fcrepo.server.messaging.Messaging" class="org.fcrepo.server.messaging.MessagingModule">
567 <comment>Fedora's Java Messaging Service (JMS) Module</comment>
568 <param name="enabled" value="true"/>
569 ...
570
5713. Update the following properties in /<GS3>/packages/tomcat/webapps/fedoragsearch/FgsConfig/fgsconfig-basic.properties
572
573gsearchBase=http://<tomcat.server>:8383
574gsearchUser=fedoraAdmin
575gsearchPass=<fedora.password>
576local.FEDORA_HOME=/<GS3>/ext/fedora3
577finalConfigPath=/<GS3>/packages/tomcat/webapps/fedoragsearch/WEB-INF/classes
578
579fedoraBase=http://<tomcat.server>:8383
580fedoraPass=<fedora.password>
581
5824. Add the edited foxmlToLucene.xslt & foxmlToLuceneGenerated.xslt files to /<GS3>/packages/tomcat/webapps/fedoragsearch/FgsConfig/FgsConfigIndexTemplate/Lucene
583
5845. Add the edited runRESTClient.sh (and runSOAPClient.sh, runRESTClient.bat) to /<GS3>/packages/tomcat/webapps/fedoragsearch/client
585And give them execute permissions, unless they already have it.
586
5876. In a text editor, open up /<GS3>/packages/tomcat/webapps/fedoragsearch/WEB-INF/web.xml
588and comment out the authentication filters (one or two of these is probably all that is necessary):
589
590<!--
591 <filter-mapping>
592 <filter-name>EnforceAuthnFilter</filter-name>
593 <servlet-name>AxisServlet</servlet-name>
594 </filter-mapping>
595 <filter-mapping>
596 <filter-name>EnforceAuthnFilter</filter-name>
597 <servlet-name>GenericSearchREST</servlet-name>
598 </filter-mapping>
599 <filter-mapping>
600 <filter-name>EnforceAuthnFilter</filter-name>
601 <url-pattern>/index.html</url-pattern>
602 </filter-mapping>
603 <filter-mapping>
604 <filter-name>EnforceAuthnFilter</filter-name>
605 <url-pattern>/rest</url-pattern>
606 </filter-mapping>
607-->
608
609Maybe what I really need to comment out is:
610 <filter>
611 <filter-name>EnforceAuthnFilter</filter-name>
612 <filter-class>org.fcrepo.server.security.servletfilters.FilterEnforceAuthn</filter-class>
613 </filter>
614
6157. Open GSearch's FgsConfig/FgsConfigIndexTemplate/Lucene/index.properties and adjust the lock timeout property to 1000 or 10000 ms:
616 fgsindex.defaultWriteLockTimeout = 10000
617
6188. Start tomcat to have it deploy fedoragsearch.
619This will unpack fedoragsearch.
620
6219. With tomcat running, configure fedoragsearch, which will adjust various config files. You will need to go into the deployed fedoragsearch webapps folder's FgsConfig folder first to be able to run the configuration target:
622
623 <GS3>/packages/tomcat/webapps/fedoragsearch/FgsConfig>ant -f fgsconfig-basic.xml
624
62519. With tomcat still running, run updateIndex once to create the empty index for the first time (by running the runRESTClient.sh script with the command: "host:port updateIndex createEmpty [indexName]")
626
627 ./<GS3>/packages/tomcat/webapps/fedoragsearch/client/runRESTClient.sh localhost:8383 updateIndex createEmpty FgsIndex
628
62911. Check fedoragsearch has been properly installed by visiting:
630http://localhost:8383/fedoragsearch/rest
631
63212. If you wish to remove the various war files from GS3's tomcat webapps folder, you will need to stop tomcat first before deleting the war files, because doing so when tomcat is running will undeploy those webapps.
633
634
635********************************
636DEBUGGING
637********************************
638
639Logs to consult when debugging:
640
6411. Check /<GS3>/packages/tomcat/logs/catalina.out
642
6432. </GS3/ext/>fedora3/server/logs/fedora.log for Fedora error logging.
644
6453. To turn on FedoraGSearch's logging of debug statements (Huge files, can reach 500 Mb in a day if rebuilding the demo collection. So you may want to switch this off when not debugging by setting the debug level to INFO):
646
647- /<GS3>/packages/tomcat/webapps/fedoragsearch/WEB-INF/classes/log4j.xml is already set to output DEBUG statements and higher logging levels
648- So open </GS3/ext/>fedora3/server/logs/fedoragsearch.daily.log to look at debug messages in case fedoragsearch doesn't work as expected.
649
650
651**************************************
652MANUALLY INDEXING DOCS WITH GSEARCH
653**************************************
654
6551. GS3> packages/tomcat/webapps/fedoragsearch/client/runRESTClient.sh <host>:<port> updateIndex fromPID <DOCID of form greenstone:COLNAME-ID>
656
657Need to provide the fedora username of "fedoraAdmin" and the fedora password, as defined in build.properties when installing fedora.
658
6592. Further commands:
660
661GS3/packages/tomcat/webapps/fedoragsearch/client>java -Xms64m -Xmx96m -Dfedoragsearch.fgsUserName=$fgsUserName -Dfedoragsearch.fgsPassword=$fgsPassword -cp ../WEB-INF/classes:$JARS dk.defxws.fedoragsearch.client.RESTClient
662
663Args
664Usage
665host:port updateIndex # shows number of index documents #
666host:port updateIndex createEmpty [indexName] # index dir must exist #
667host:port updateIndex fromFoxmlFiles [repositoryName [filePath [indexName [indexDocXslt]]]]
668host:port updateIndex fromPid pid [repositoryName [indexName [indexDocXslt]]]
669host:port updateIndex deletePid pid [indexName]
670host:port updateIndex optimize [indexName]
671host:port browseIndex startTerm fieldName [indexName [termPageSize [resultPageXslt]]]
672host:port gfindObjects query [indexName [hitPageStart [hitPageSize [snippetsMax [fieldMaxLength [sortFields [resultPageXslt]]]]]]]
673host:port getRepositoryInfo [repositoryName [resultPageXslt]]
674host:port getIndexInfo [indexName [resultPageXslt]]
675host:port configure [configName [propertyName propertyValue]]
676host:port ?operation=...&...=...&...
677host:port may be [protocol://]host:port[/webappname/restname], default is http://host:port/fedoragsearch/rest
678
679********************************************************************************************************************
Note: See TracBrowser for help on using the repository browser.