Project

General

Profile

1 878 berkley
<!--
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$'
9
  *      '$Date$'
10
  *  '$Revision$'
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 880 jones
   <pre>cvs checkout -P xmltodb</pre>  Or you can
193 878 berkley
   <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 880 jones
      &lt;property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/&gt;
204 878 berkley
      &lt;property name="installdir" value="/opt/tomcat/webapps/metadata" /&gt;
205
      &lt;property name="name" value="metacat"/&gt;
206
      &lt;property name="Name" value="MetaCat"/&gt;
207 880 jones
      &lt;property name="release" value="1.0.1"/&gt;
208
      &lt;property name="web-base-url" value="http://knb.ecoinformatics.org"/&gt;
209 878 berkley
      &lt;property name="replication-path" value="/metadata/servlet/replication"/&gt;
210
      &lt;property name="servlet-path" value="/metadata/servlet/metacat"/&gt;
211
      &lt;property name="html-path" value="/metadata"/&gt;
212
      &lt;property name="image-path" value="/img/metadata" /&gt;
213 880 jones
      &lt;property name="style-path" value="/jones/style"/&gt;
214
      &lt;property name="server" value="metacat.nceas.ucsb.edu"/&gt;
215 878 berkley
      &lt;property name="replication-log" value="metacatreplication.log"/&gt;
216
      &lt;property name="user" value="metadata"/&gt;
217
      &lt;property name="password" value="your-pw-goes-here"/&gt;
218 880 jones
      &lt;property name="config-dir" value="${installdir}" /&gt;
219
      &lt;property name="default-style" value="knb" /&gt;
220
      &lt;property name="eml-module" value="mdstandards/eml" /&gt;
221
      &lt;property name="eml-version" value="2.0.0beta6" /&gt;
222
      &lt;property name="eml-tag" value="RELEASE_EML_2_0_0_BETA_6" /&gt;
223
      &lt;property name="cvsroot"
224
               value=":ext:jones@cvs.nceas.ucsb.edu:/cvs/pbi" /&gt;
225
226
227 878 berkley
   </pre>
228
  </p>
229
  <p>
230 880 jones
   The configuration changes that you need to make are the jdbc-connect,
231
   installdir, web-base-url, replication-path, servlet-path, html-path,
232
   image-path, style-path, server, replication-log, user and password.
233
   Each is described below.
234 878 berkley
  </p>
235
  <ul>
236
  <li>
237
   The jdbc-connect parameter is the JDBC connection string needed to connect
238 880 jones
   to your database.
239 878 berkley
  </li>
240
  <li>
241 880 jones
   The dbDriver parameter is the name of the JDBC driver class to use for
242
   connections to your database.  If you are not using Oracle, you will also
243
   need to change the name of the database adapter class in the dbAdapter
244
   property in the <a href="./properties.html"?>metacat.properties</a> file.
245
  </li>
246
  <li>
247 878 berkley
   The installdir
248
   parameter is the directory that you want Ant to install the servlet to.
249
   It is your "servlet context path" that was defined above.
250
  </li>
251
  <li>
252 880 jones
   Web-base-url is the URL from which you want to load any stylesheets
253
   or supplementary images.
254 878 berkley
  </li>
255
  <li>
256 880 jones
   Replication path is the relative path to the replication servlet.  This
257 878 berkley
   should be the name of your servlet followed by "/servlet/replication".
258
  </li>
259
  <li>
260
   The servlet path is the relative path to your servlet as viewed by the
261
   Tomcat or Apache web server.  Under Tomcat, the form is usually
262
   <pre>/&lt;servlet-context-name&gt;/servlet/&lt;servlet-name&gt;</pre>
263
   In the example above "metadata" is the name of the servlet context and
264
   "metacat" is the name of the servlet.
265
  </li>
266
  <li>
267
   The html-path is usually the first directory of the servlet-path. The only
268
   reason it wouldn't be is if you are doing something with your web server
269
   and you want the html served from a different location than where the
270
   servlet is located.
271
  </li>
272
  <li>
273
   The image-path is where you want the Metacat image files stored.  It
274
   should be a directory that is accessible by the web server.
275
  </li>
276
  <li>
277
   Server is the full internet name of the server on which Metacat is running.
278
  </li>
279
  <li>
280
   Replication-log is the location at which you want Metacat to place any
281
   replication log files.  The user that starts Tomcat must have permission to
282
   write to this directory.
283
  </li>
284
  <li>
285 880 jones
   The user and password parmaters are the database user name that you set up
286
   to use Metacat, for example an Oracle username and password.
287 878 berkley
  </li>
288 880 jones
  <li>
289
   The config-dir parameter specifies the location of the configuration files
290
   for the "style-sets" feature.  It is set by default to the installation
291
   directory and generally does not need to be changed.
292
  </li>
293
  <li>
294
   The default-style parameter defines the "style-set" that is to be used
295
   by default when the qformat parameter is missing or set to "html" during
296
   a query.  It is set to "knb", which is the only style that ships with the
297
   default metacat distribution.  If you create your own stylesheets for
298
   displaying metacat output, you may want to create a new config file in the
299
   config-dir (e.g., mystyle.xml) and then change the default-style to use
300
   your custom style (e.g., "mystyle").
301
  </li>
302
  <li>
303
   The eml-module, eml-version, eml-tag parameters control the installation
304
   behavior with respect to EML.  You should not need to change these paramters.
305
  </li>
306
  <li>
307
   The cvsrootparameter is used when building the distribution and you should
308
   not need to change it.
309
  </li>
310 878 berkley
  </ul>
311
  <p class="emphasis">
312
   Note: DO NOT add a slash [/] to the end of these paths.  Metacat will not
313
   function correctly if you do so.
314
  </p>
315
  <p class="header">Stylesheet Scripts</p>
316
  <p>
317
   You now need to set up the table structure in your database.  Change to the
318
   xmltodb/src directory.  Then run you RDBMS's SQL utility.  In Oracle it is
319
   SQLPlus.  This tutorial assumes an Oracle database so this example is for
320
   SQLPlus.  Login as the oracle user that was set up for use with Metacat.
321
   At the SQLPlus prompt type the following: <pre>@xmltables.sql;</pre>
322
   You should see a bunch of output showing the creation of the Metacat table
323
   space. The first time you run this script you will get several errors at the
324
   beginning saying that you cannot drop a table/index/trigger because it
325
   does not exist.  This is normal.  Any other errors besides this need to be
326
   resolved before continuing.
327
  </p>
328
  <p>
329
   If the script has run correctly you should be able to type
330
   <pre>describe xml_documents</pre> and it should tell you
331
   <pre>
332
    Name            Null?         Type
333
    --------------  ------------  ----------------
334
     DOCID          NOT NULL      VARCHAR2(250)
335
     ROOTNODEID                   NUMBER(20)
336
     DOCNAME                      VARCHAR2(100)
337
     DOCTYPE                      VARCHAR2(100)
338
     DOCTITLE                     VARCHAR2(1000)
339
     USER_OWNER                   VARCHAR2(100)
340
     USER_UPDATED                 VARCHAR2(100)
341
     SERVER_LOCATION              NUMBER(20)
342
     REV                          NUMBER(10)
343
     DATE_CREATED                 DATE
344
     DATE_UPDATED                 DATE
345
     PUBLIC_ACCESS                NUMBER(1)
346
     UPDATED                      NUMBER(1)
347
   </pre>
348
  </p>
349
</td>
350
</tr>
351
</table>
352
353
<table class="tabledefault" width="100%">
354
<td class="tablehead" colspan="2"><p>Compilation and Installation</p></td>
355
<tr>
356
<td>
357
  <a name="protocol"></a>
358
  <p>
359
   Now we are ready to finish setting up Tomcat by creating the protocol.jar
360
   file.  To do this, change into the xmltodb directory and type
361
   <pre>ant protocol</pre>
362
   When it is done and says "BUILD SUCCESSFUL", change into the 'build'
363
   directory.  There will be a file there called 'protocol.jar'.  Now, copy
364
   that file to {tomcat install directory}/lib/protocol.jar.  In our case:
365
   <pre>cp protocol.jar /usr/local/devtools/jakarta-tomcat/lib/.</pre>
366
   <div class="emphasis">Note that once you have installed the protocol handlers
367
   you do not need to install them again.  You can recompile Metacat and install
368
   it without having to go through this process again.</div>
369
  </p>
370
  <p>
371
   Once the protocol.jar file is compiled and copied, you are ready to compile
372
   and install
373
   Metacat.  Ant allows compilation and installation to be done in one step.
374
   Change into the xmltodb directory and type:
375
   <pre>ant install</pre>
376
   You should see a bunch of messages telling you the progress of compilation
377
   and installation.  When it is done you should see the message BUILD SUCCESSFUL
378
   and you should be returned to a UNIX command prompt.  If you do not see
379
   the message BUILD SUCCESSFUL then there was an error that you need to resolve.
380
   This may come up if you are logged in as a user that does not have write
381
   access to one or more of the directories that are listed in the build.xml
382
   file.
383
  </p>
384 880 jones
  <p>Once metacat itself is installed, you have the option of also installing
385
  the Ecological Metadata Language (EML) DTDs. This process is done most
386
  easily by running "ant instdtd" which copies the DTDs to the installation
387
  directory, and then "ant dtdsql" which registers the DTDs with the
388
  metacat server.  Your database username and password have to be set correctly
389
  for this to work.
390 878 berkley
  <p>
391
   Once you have successfully installed Metacat, there is one more step.  Tomcat
392
   (and Apache if you have Tomcat integrated with it) must be restarted.  To do
393
   this go to {Tomcat install directory}/bin and type
394
   <pre>
395
   ./tomcat.sh stop
396
   ./tomcat.sh start
397
   </pre>
398
   In the Tomcat startup messages you should see something like:
399
   <pre>
400
    MetacatServlet Initialize
401
    Context log path="/metadata" :Metacat: init
402
    MetacatServlet Initialize
403
   </pre>
404
   If you see that message Tomcat is successfully loading the Metacat servlet.
405
   Next, try to run your new servlet.  Go to a web browser and type:
406
   <pre>http://yourserver.yourdomain.com/metadata/</pre>
407
   If everything is working correctly, you should see a query page followed
408 880 jones
   by an empty result set.  Note that if you do not have Tomcat integrated with
409 878 berkley
   Apache you will probably have to type
410
   <pre>http://yourserver.yourdomain.com:8080/metadata/</pre>
411
  </p>
412
</td>
413
</tr>
414
</table>
415
416
</body>
417
</html>