Project

General

Profile

1
<!-- 
2
  *   '$RCSfile$'
3
  *     Purpose: web page describing the installation of Metacat
4
  *   Copyright: 2000 Regents of the University of California and the
5
  *               National Center for Ecological Analysis and Synthesis
6
  *     Authors: Chad Berkley
7
  *
8
  *    '$Author: berkley $'
9
  *      '$Date: 2001-12-18 10:11:42 -0800 (Tue, 18 Dec 2001) $'
10
  *  '$Revision: 878 $'
11
  *
12
  *
13
  -->
14
  
15
<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.0//EN">
16
<html>
17

    
18
<head>
19
  <title>Metacat Installation Instructions</title>
20
  <link rel="stylesheet" type="text/css" href="@docrooturl@default.css">
21
</head>
22

    
23
<body>
24

    
25
<table class="tabledefault" width="100%">
26
<tr><td rowspan="2"><img src="@docrooturl@images/KNBLogo.gif"></td>
27
<td colspan="7">
28
<div class="title">Metacat UNIX Installation Instructions</div>
29
</td>
30
</tr>
31
<tr>
32
  <td><a href="@server@/" class="toollink"> KNB Home </a></td>
33
  <td><a href="@server@/data.html" class="toollink"> Data </a></td>
34
  <td><a href="@server@/people.html" class="toollink"> People </a></td>
35
  <td><a href="@server@/informatics" class="toollink"> Informatics </a></td>
36
  <td><a href="@server@/biodiversity" class="toollink"> Biocomplexity </a></td>
37
  <td><a href="@server@/education" class="toollink"> Education </a></td>
38
  <td><a href="@server@/software" class="toollink"> Software </a></td>
39
</tr>
40
</table>
41
<hr>
42

    
43
<table class="tabledefault" width="100%">
44
<td class="tablehead" colspan="2"><p class="emphasis">***Disclaimer***</p></td>
45
<tr>
46
<td>
47
  <p class="emphasis">
48
   These installation instructions are meant for a systems administrator/DBA or someone
49
   who is an advanced computer user.  They are NOT meant for the average computer user.
50
   Please realize that by executing these instructions, you may have to trouble shoot
51
   many advanced issues yourself.
52
</td>
53
</tr>
54
</table>
55

    
56
<table class="tabledefault" width="100%">
57
<td class="tablehead" colspan="2"><p>Pre-Installation</p></td>
58
<tr>
59
<td>
60
  <p class="header">Minimum Requirements</p> 
61
  <p>
62
   Installing Metacat requires a server running an SQL92 compliant database
63
   (Oracle 8i recommended) with at least 128MB RAM, and a Pentium III class
64
   processor or higher.  The amount of disk space required depends on the
65
   size of your RDBMS tablespace (which should be at least 10 MB, 
66
   however Metacat itself requires only about 1 MB of free space after 
67
   installation.  These instructions assume a Linux environment but may
68
   work on other UNIX type environments, however this has not been tested.
69
  </p>
70
  <p class = "header">Additional Required Software</p>
71
  <p>
72
   The server on which you wish to install Metacat must have the following
73
   software installed and running correctly before attempting to install
74
   Metacat.
75
   <ul>
76
     <li><a href="http://www.oracle.com">Oracle 8i</a> (or another SQL92
77
         compliant RDBMS)</li>
78
     <li><a href="http://jakarta.apache.org/ant/index.html">Apache Jakarta-Ant</a>
79
     </li>
80
     <li><a href="http://jakarta.apache.org/tomcat/index.html">Apache Jakarta-Tomcat</a>
81
       <p class="emphasis">Note: For a more robust web serving environment, Apache web server should
82
       be installed along with Tomcat and the two should be integrated
83
       as described on the Apache web site.</p>
84
     </li>
85
   </ul>
86
  </p>
87
</td>
88
</tr>
89
</table>
90

    
91
<table class="tabledefault" width="100%">
92
<td class="tablehead" colspan="2"><p>Aditional Software Setup</p></td>
93
<tr>
94
<td>
95
  <p class="header">Oracle 8i</p>
96
  <p>
97
   The Oracle RDBMS must be installed and running as a daemon on the system.
98
   In addition the JDBC listener must be enabled.  You can enable it by
99
   logging in as your Oracle user and typing the following:
100
   <pre>lsnrctl start</pre>
101
   Your instance should have a table space of at least 5 MB (10 MB or higher 
102
   recommended).  You should also have a username specific to Metacat
103
   created and enabled.  This user must have most normal permissions 
104
   including CREATE SESSION, CREATE TABLE, CREATE INDEX, CREATE TRIGGER, 
105
   EXECUTE PROCEDURE, EXECUTE TYPE, etc.  If an action is unexplainably 
106
   rejected by Metacat it is probably because the user permissions are not
107
   correctly set.
108
  </p>
109
  <p class="header">Ant</p>
110
  <p>
111
   Ant is a Java based build application similar to Make on UNIX systems.  
112
   It takes in installation parameters from a file in the root installation
113
   directory named "build.xml".  The Metacat CVS module contains a default
114
   build.xml file that may require some modification upon installation.  Ant
115
   Should be installed on the system and the "ant" executable shell script 
116
   should be available in the users path.
117
  </p>
118
  <p class="header">Tomcat</p>
119
  <p>
120
    Install tomcat into the directory of your choice. The directory in which 
121
    you install Tomcat itself will be referred to as the "{Tomcat install 
122
    directory}".  This install assumes Tomcat version 3.1.  The Tomcat configuration
123
    will be slightly different depending on what version of Tomcat you are running.
124
  </p>
125
  <p>
126
    You must now set up your servlet context.  Change to the {Tomcat install 
127
    directory}/conf.  Edit the tomcat.conf file.  Find a line that looks like:
128
    <pre>ApJServMount /examples /root</pre>  
129
    Add the following line below the aforementioned text:
130
    <pre>ApJServMount /metadata /root</pre>
131
    Save tomcat.conf.
132
  </p>
133
  <p>
134
   Edit the server.xml file.  Go to the bottom of the file.  Find the line that
135
   says: 
136
   <pre>&lt;Context path="/examples" docbase="/webapps/examples" debug="0" reloadable="true" &gt;
137
   &lt;/Context&gt;</pre>
138
   Directly below these lines enter the following:
139
   <pre>&lt;Context path="/metadata" docbase="/opt/tomcat/webapps/metadata" debug="0" reloadable="true" &gt;
140
   &lt;/Context&gt;</pre>
141
   Save server.xml.
142
   <div class="emphasis">Note that capital "C" on "Context".  This MUST be a 
143
   capital "C".  Also note that "metadata" is an arbitrary servlet name.  You
144
   may pick whatever servlet name you wish.</div>
145
  </p>
146
  <p>
147
   After setting up Tomcat, you must make a slight modification to the startup
148
   script.  Tomcat needs to know about special protocol handlers that Metacat
149
   uses for its URLs.  Find the line in the tomcat.sh file that says 
150
   <pre>
151
    if [ "$TOMCAT_OPTS" = "" ] ; then
152
     TOMCAT_OPTS=""
153
    fi
154
   </pre>
155
   It should be on about line 65.  You need to comment out the TOMCAT_OPTS
156
   entry that is there and add the following:
157
   <pre>
158
    TOMCAT_OPTS="-Djava.protocol.handler.pkgs=edu.ucsb.nceas.protocols"
159
   </pre>
160
   When you are done the if statement should look like:
161
   <pre>
162
    if [ "$TOMCAT_OPTS" = "" ] ; then
163
     #TOMCAT_OPTS=""
164
     TOMCAT_OPTS="-Djava.protocol.handler.pkgs=edu.ucsb.nceas.protocols"
165
    fi
166
   </pre>
167
   You must also complete the <a href="#protocol">protocol.jar</a> step below 
168
   for this to be completely
169
   setup.  Also, make sure that this startup script is always used to start
170
   tomcat or the parameter will not be set correctly and some features of
171
   Metacat will not work.
172
  </p>
173
  <p>
174
   Your servlet context should now be setup.  The next step is giving Tomcat
175
   something to run in that context (i.e. Metacat).
176
  </p>
177
</td>
178
</tr>
179
</table>
180

    
181
<table class="tabledefault" width="100%">
182
<td class="tablehead" colspan="2"><p>Configuring the Server for Metacat</p></td>
183
<tr>
184
<td>
185
  <p>
186
   Once all of the prerequisite software is installed as described above, 
187
   the installation of Metacat can begin.  First you must have a current
188
   version of the source distribution of Metacat.  You can get it two ways.
189
   Authorized users can check it out of the NCEAS 
190
   <a href="http://www.nceas.ucsb.edu/cgi-bin/cvsweb.cgi/xmltodb/">CVS</a>
191
   system under the module name xmltodb.  The command is as follows: 
192
   <pre>cvs checkout xmltodb</pre>  Or you can 
193
   <a href="@server@/software/download.html">download</a> a gzipped tar file
194
   from this site.
195
  </p>
196
  <p>
197
   Once you have either checked out or unzipped and untarred the source
198
   distribution, you can begin the installation process.  Change into the 
199
   xmltodb directory and edit the file called "build.xml".  The top of a 
200
   sample build.xml file is shown below.
201
   <pre>
202
      &lt;property name="jdbc-connect" value="jdbc:oracle:thin:@dev.nceas.ucsb.edu:1521:exp"/&gt;
203
      &lt;property name="installdir" value="/opt/tomcat/webapps/metadata" /&gt;
204
      &lt;property name="name" value="metacat"/&gt;
205
      &lt;property name="Name" value="MetaCat"/&gt;
206
      &lt;property name="release" value="1.0a8"/&gt;
207
      &lt;property name="web-base-url" value="http://www.nceas.ucsb.edu/collab/2840/knbweb"/&gt;
208
      &lt;property name="replication-path" value="/metadata/servlet/replication"/&gt;
209
      &lt;property name="servlet-path" value="/metadata/servlet/metacat"/&gt;
210
      &lt;property name="html-path" value="/metadata"/&gt;
211
      &lt;property name="image-path" value="/img/metadata" /&gt;
212
      &lt;property name="server" value="dev.nceas.ucsb.edu"/&gt;
213
      &lt;property name="replication-log" value="metacatreplication.log"/&gt;
214
      &lt;property name="dataport" value="4444"/&gt;
215
      &lt;property name="user" value="metadata"/&gt;
216
      &lt;property name="password" value="your-pw-goes-here"/&gt;
217
   </pre>
218
  </p>
219
  <p>
220
   The configuration changes that you need to make are the jdbc-connect, installdir, 
221
   web-base-url, replication-path, servlet-path, html-path, image-path, server, 
222
   replication-log, user and password.  Each is described
223
   below.
224
  </p>
225
  <ul>
226
  <li>
227
   The jdbc-connect parameter is the JDBC connection string needed to connect 
228
   to your database.  If you are not using Oracle, you will also need to change
229
   the name of the JDBC driver in the <a href="./properties.html"?>metacat.properties</a>
230
   file.
231
  </li>
232
  <li>
233
   The installdir
234
   parameter is the directory that you want Ant to install the servlet to.
235
   It is your "servlet context path" that was defined above.
236
  </li>
237
  <li>
238
   Web-base-url is the URL from which you want to load any stylesheets or supplementary 
239
   images.
240
  </li>
241
  <li>
242
   Replication path is the relative path to the replication servlet.  This is 
243
   should be the name of your servlet followed by "/servlet/replication".
244
  </li>
245
  <li>
246
   The servlet path is the relative path to your servlet as viewed by the 
247
   Tomcat or Apache web server.  Under Tomcat, the form is usually
248
   <pre>/&lt;servlet-context-name&gt;/servlet/&lt;servlet-name&gt;</pre>
249
   In the example above "metadata" is the name of the servlet context and 
250
   "metacat" is the name of the servlet.
251
  </li>
252
  <li>
253
   The html-path is usually the first directory of the servlet-path. The only 
254
   reason it wouldn't be is if you are doing something with your web server
255
   and you want the html served from a different location than where the 
256
   servlet is located.
257
  </li>
258
  <li>
259
   The image-path is where you want the Metacat image files stored.  It
260
   should be a directory that is accessible by the web server.
261
  </li>
262
  <li>
263
   Server is the full internet name of the server on which Metacat is running.
264
  </li>
265
  <li>
266
   Replication-log is the location at which you want Metacat to place any 
267
   replication log files.  The user that starts Tomcat must have permission to
268
   write to this directory.
269
  </li>
270
  <li>
271
   The user and password parmaters are the Oracle user name that you set up
272
   to use Metacat.
273
  </li>
274
  </ul>
275
  <p class="emphasis">
276
   Note: DO NOT add a slash [/] to the end of these paths.  Metacat will not
277
   function correctly if you do so.
278
  </p>
279
  <p class="header">Stylesheet Scripts</p>
280
  <p>
281
   You now need to set up the table structure in your database.  Change to the
282
   xmltodb/src directory.  Then run you RDBMS's SQL utility.  In Oracle it is
283
   SQLPlus.  This tutorial assumes an Oracle database so this example is for
284
   SQLPlus.  Login as the oracle user that was set up for use with Metacat.
285
   At the SQLPlus prompt type the following: <pre>@xmltables.sql;</pre>
286
   You should see a bunch of output showing the creation of the Metacat table
287
   space. The first time you run this script you will get several errors at the 
288
   beginning saying that you cannot drop a table/index/trigger because it 
289
   does not exist.  This is normal.  Any other errors besides this need to be
290
   resolved before continuing.
291
  </p>
292
  <p>
293
   If the script has run correctly you should be able to type 
294
   <pre>describe xml_documents</pre> and it should tell you
295
   <pre>
296
    Name            Null?         Type
297
    --------------  ------------  ---------------- 
298
     DOCID          NOT NULL      VARCHAR2(250)
299
     ROOTNODEID                   NUMBER(20)
300
     DOCNAME                      VARCHAR2(100)
301
     DOCTYPE                      VARCHAR2(100)
302
     DOCTITLE                     VARCHAR2(1000)
303
     USER_OWNER                   VARCHAR2(100)
304
     USER_UPDATED                 VARCHAR2(100)
305
     SERVER_LOCATION              NUMBER(20)
306
     REV                          NUMBER(10)
307
     DATE_CREATED                 DATE
308
     DATE_UPDATED                 DATE
309
     PUBLIC_ACCESS                NUMBER(1)
310
     UPDATED                      NUMBER(1)
311
   </pre>
312
  </p>
313
</td>
314
</tr>
315
</table>
316

    
317
<table class="tabledefault" width="100%">
318
<td class="tablehead" colspan="2"><p>Compilation and Installation</p></td>
319
<tr>
320
<td>
321
  <a name="protocol"></a>
322
  <p>
323
   Now we are ready to finish setting up Tomcat by creating the protocol.jar
324
   file.  To do this, change into the xmltodb directory and type 
325
   <pre>ant protocol</pre>
326
   When it is done and says "BUILD SUCCESSFUL", change into the 'build' 
327
   directory.  There will be a file there called 'protocol.jar'.  Now, copy 
328
   that file to {tomcat install directory}/lib/protocol.jar.  In our case: 
329
   <pre>cp protocol.jar /usr/local/devtools/jakarta-tomcat/lib/.</pre>
330
   <div class="emphasis">Note that once you have installed the protocol handlers
331
   you do not need to install them again.  You can recompile Metacat and install
332
   it without having to go through this process again.</div>
333
  </p>
334
  <p>
335
   Once the protocol.jar file is compiled and copied, you are ready to compile 
336
   and install
337
   Metacat.  Ant allows compilation and installation to be done in one step.
338
   Change into the xmltodb directory and type: 
339
   <pre>ant install</pre>
340
   You should see a bunch of messages telling you the progress of compilation
341
   and installation.  When it is done you should see the message BUILD SUCCESSFUL
342
   and you should be returned to a UNIX command prompt.  If you do not see
343
   the message BUILD SUCCESSFUL then there was an error that you need to resolve.
344
   This may come up if you are logged in as a user that does not have write
345
   access to one or more of the directories that are listed in the build.xml
346
   file. 
347
  </p>
348
  <p>
349
   Once you have successfully installed Metacat, there is one more step.  Tomcat
350
   (and Apache if you have Tomcat integrated with it) must be restarted.  To do
351
   this go to {Tomcat install directory}/bin and type 
352
   <pre>
353
   ./tomcat.sh stop
354
   ./tomcat.sh start
355
   </pre>
356
   In the Tomcat startup messages you should see something like:
357
   <pre>
358
    MetacatServlet Initialize
359
    Context log path="/metadata" :Metacat: init
360
    MetacatServlet Initialize
361
   </pre>
362
   If you see that message Tomcat is successfully loading the Metacat servlet.
363
   Next, try to run your new servlet.  Go to a web browser and type:
364
   <pre>http://yourserver.yourdomain.com/metadata/</pre>
365
   If everything is working correctly, you should see a query page followed
366
   by a null result set.  Note that if you do not have Tomcat integrated with
367
   Apache you will probably have to type
368
   <pre>http://yourserver.yourdomain.com:8080/metadata/</pre>
369
  </p>
370
</td>
371
</tr>
372
</table>
373

    
374
</body>
375
</html>
(23-23/45)