source: trunk/gsdl3/INSTALL@ 5430

Last change on this file since 5430 was 5430, checked in by kjdon, 21 years ago

added some info about tomcat config for following symlinks and preventing directory listings

  • Property svn:keywords set to Author Date Id Revision
File size: 6.3 KB
Line 
1INSTALLATION GUIDE FOR GSDL3
2
3This stuff is all done by a script now:
4just need to carry out the following:
5
6source setup.bash
7install.bash
8source setup.bash
9
10Note: if you are using mozilla it doesn't seem to like localhost - you should edit the siteConfig files (web/sites/<sitename>/siteConfig.xml) to have your computer name instead of localhost.
11
12Note: the second setup.bash is needed to add the newly created jar files to the CLASSPATH
13
14if you want to use soap, also run
15install-soap.bash
16you shouldn't run this more than once.
17
18You should now be able to run greenstone - go to localhost:8080/gsdl3, and 'run the library servlet'.
19
20Do not run install.bash more than once. If you need to update your stuff from cvs, or recompile things etc, you can run update.bash.
21
22Some notes for subsequent running of gsdl3:
23
24TOMCAT:
25
26Tomcat is a servlet container. It is used to serve a greenstone site using a servlet.
27
28The file $GSDL3HOME/web/WEB-INF/web.xml contains the setup information for tomcat---tells it what servlets to load, what initial paramaters to pass them, and what web names map to the servlets.
29There are three servlets specified in web.xml: one is a test servlet that just prints ``hello greenstone'' to a web page. This is useful for testing tomcat. The other two are greenstone library servlets, ``library'', which serves localsite, and ``library1'' which serves site1.
30
31To run tomcat, you need to have sourced setup.bash in $GSDL3HOME to set up $CLASSPATH. Then,
32
33cd $gsdlhome/comms/jakarta/tomcat/bin
34./startup.sh
35
36./shutdown.sh shuts down tomcat
37
38The tomcat server can be accessed on the web at http://localhost:8080---this gets you to a welcome page.
39The greenstone stuff is at http://localhost:8080/gsdl3---this displays $GSDL3HOME/web/index.html. You should be able to run the test servlet and both library servlets from this page.
40
41Note: tomcat must be shutdown and restarted any time you make changes in the following for those changes to take effect:
42web/WEB-INF/web.xml
43comms/jakarta/tomcat/conf/server.xml
44any classes or jar files used by the servlets
45
46Also if you change any collections, you can restart tomcat to reload them.
47
48Note: stdin and stdout for the servlets both go to $GSDL3HOME/comms/jakarta/tomcat/logs/catalina.out
49
50Symlinks:
51
52Tomcat by default doesn't follow symlinks (although the symlink to lib seems to work). To make it follow symlinks, eg to have the collect directory of a site somewhere else, you need to add the following to tomcats server.xml ($GSDL3HOME/comms/jakarta/tomcat/conf/server.xml):
53<Resources allowLinking='true'/>
54This needs to go inside the gsdl3 context, i.e.
55
56<Context path="/gsdl3" docBase="$GSDL3HOME/web" debug="1"
57reloadable="true">
58 <Resources allowLinking='true'/>
59</Context>
60
61By default, tomcat allows directory listings for everything in the docBase directory. For example, you can enter localhost:8080/gsdl3/sites and it will give you a list of all the sites. To turn this off, you need to edit Tomcat's default web.xml file ($GSDL3HOME/comms/jakarta/tomcat/conf/web.xml):
62
63In the default servlet definition, change the 'listings' param to false.
64
65SITES:
66There are two greenstone "sites" that come with the checkout: localsite, and site1. localsite has several collections, only two of which have any actual data. The third is a dummy collection. site1 has one dummy collection. Each site has a configuration file which specifies the site name, site-wide services if any, and a list of remote sites to connect to.
67localsite does not connect to any other sites. site1 specifies a SOAP connection to localsite.
68
69The collections which do not have data can be looked at but you cant do any queries on them.
70
71SOAP:
72
73site1 specifies a SOAP connection to localsite. If you run site1 without connecting to localsite, you can only see the local collections, eg the dummy collection myfiles. However, if you connect to localsite, you can see all of its collections as well.
74
75The SOAP server we use is actually run as a servlet in tomcat. The install-soap.bash script sets up SOAP, sets up the SOAP server class which will be your service, and then deploys that service.
76
77You can also deploy services through the web interface.
78The SOAP servlet can be accessed at http://localhost:8080/soap. You should see a welcome page. Click on ``Run the admin client''. This enables you to list, deploy and undeploy SOAP services.
79
80To deploy the SOAPServer for localsite:
81
82Click on ``deploy'' and edit the following fields in the deploy form:
83
84
85ID: org.greenstone.localsite
86Scope: (any will do) Request---new instantiation for each reques
87 Session---same instantiation across a session
88 Application---only uses one instantiation
89Methods: process
90Java Provider / Provider Class: org.greenstone.gsdl3.SOAPServer
91
92
93Now click the ``deploy'' button at the bottom of the page. If the service has been deployed, it should appear when you click on the lefthand ``List'' button.
94
95Information about deployed services is maintained between tomcat sessions---you only need to deploy it once. To get the library1 servlet talking to the SOAP server, you need to shutdown and restart tomcat (see above). You should see more collections when you run the library1 servlet.
96
97Debugging SOAP
98
99If you need to debug the SOAP stuff for some reason, or just want to look at the SOAP messages that are being passed back and forth, there is a program called TcpTunnelGui. This intercepts messages coming in to one port, displays them, and passes them to another port.
100
101To run it:
102
103java org.apache.soap.util.net.TcpTunnelGui 8070 localhost 8080
104
105tomcat uses port 8080 - you need to modify greenstone to talk to port 8070 instead of 8080. - this is specified in the 'site' element of the site configuration file.
106
107eg, in sites/site1/siteConfig.xml:
108
109<site name="org.greenstone.localsite"
110 address="http://localhost:8080/soap/servlet/rpcrouter"
111 type="soap"/>
112
113You can replace the 8080 with 8070 if you want to run TcpTunnelGui.
114
115Note that http://localhost:8080/soap/servlet/rpcrouter is the
116address for talking to the tomcat SOAP servlet services.
117
118Note: you can change tomcat to use a different port if you like. Edit comms/jakarta/tomcat/conf/server.xml, and change 8080 to whatever. If you do this, and are using soap, you need to remember to change the port number in:
119
120the install-soap.bash file where it tries to deploy site1.
121the siteConfig.xml file for any site that wants to talk to a soap service running on this tomcat.
122
Note: See TracBrowser for help on using the repository browser.