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: tao $'
9
  *    '$Date: 2007-08-27 18:05:35 -0700 (Mon, 27 Aug 2007) $'
10
  *    '$Revision: 3377 $'
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
49
   or someone who is an advanced computer user.  They are NOT meant for
50
   the average computer user.  Please realize that by executing these
51
   instructions, you may have to trouble shoot 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 or Postgresql 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 like Postgres)</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, 
82
       Apache web server should
83
       be installed along with Tomcat and the two should be integrated
84
       as described on the Apache web site.</p>
85
     </li>
86
   </ul>
87
  </p>
88
</td>
89
</tr>
90
</table>
91

    
92
<table class="tabledefault" width="100%">
93
<td class="tablehead" colspan="2"><p>Aditional Software Setup</p></td>
94
<tr>
95
<td>
96
  <p class="header">Java</p>
97
  <p>You'll need a recent Java SDK; J2SE 1.4.2 or later is required.  The latest metacat release
98
  has been tested most extensively with <a href="http://java.sun.com/j2se/1.5.0/">J2SE 5.0</a>
99
  and this is the recommended version.
100
  Make sure that JAVA_HOME environment variable is properly set and that both
101
  java and javac are on your PATH.
102
  </p>
103
  <p class="header">Oracle 8i or Postgres</p>
104
  <p><i>Oracle:</i><br>
105
   The Oracle RDBMS must be installed and running as a daemon on the system.
106
   In addition the JDBC listener must be enabled.  You can enable it by
107
   logging in as your Oracle user and typing the following:
108
   <pre>lsnrctl start</pre>
109
   Your instance should have a table space of at least 5 MB (10 MB or higher 
110
   recommended).  You should also have a username specific to Metacat
111
   created and enabled.  This user must have most normal permissions 
112
   including CREATE SESSION, CREATE TABLE, CREATE INDEX, CREATE TRIGGER, 
113
   EXECUTE PROCEDURE, EXECUTE TYPE, etc.  If an action is unexplainably 
114
   rejected by Metacat it is probably because the user permissions are not
115
   correctly set.
116
  </p>
117
  <p><i>Postgres:</i><br>
118
  Postgres can be easily installed on most linux distributions and on
119
  Windows (using cygwin) and Mac OS X.  Using Fedora Core or RedHat Linux,
120
  you can install the rpms for postgres and then run 
121
  <code>/etc/init.d/postgresql start</code> in order to start the database. 
122
  On Ubuntu and other Debian-based Linux distributions, you can use the apt-get command
123
  to install postgres: <code>sudo apt-get install postgresql-8.0</code> and 
124
  then run <code>/etc/init.d/postgresql-8.0 start</code> to start.
125
  
126
  This initializes the data files.  You need to do a bit of configuration
127
  to create a database and set up a user account and allow internet access
128
  via jdbc.  See the postgres documentation for this, but here is a quick 
129
  start:
130
  <ul>
131
     <li>Switch to the "postgres" user account and edit "data/pg_hba.conf", adding the following line to the file:<br>
132
     <code>host   metacat  metacat      127.0.0.1         255.255.255.255   password</code><br>
133
     If your host uses IPv6 addresses, you made need this line instead:
134
     <code>host   metacat  metacat      ::1               ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff password</code></li>
135
     <li>If you are using Postgresql pre-8.0, you must edit the "data/postgres.conf" file and uncomment and edit the line
136
     starting with "tcpip_socket" so that it reads 
137
     <code>tcpip_socket = true</code></li>
138
     <li>Run <code>createdb metacat</code> to create a new database</li>
139
     <li>Run <code>psql metacat</code> to log in using the postgres account and create a new "metacat" user account
140
     <ul>
141
        <li>In postgres, run <code>CREATE USER metacat WITH UNENCRYPTED PASSWORD 'apasswordyoulike';</code></li>
142
        <li>This creates a new account called metacat on the database named metacat</li>
143
        <li>Note: there are many ways to do this, so others such as using 
144
        ENCRYPTED passwords will work fine.</li>
145
     </ul>
146
     </li>
147
     <li>Exit the postgres account back to root and restart the postgres 
148
     database with <code>/etc/init.d/postgresql restart</code></li>
149
     <li>Test logging into the postgres db using the metacat account with 
150
     the following command: 
151
     <code>psql -U metacat -W -h localhost metacat</code></li>
152
  </ul>
153
  </p>
154
  <p class="header">Ant</p>
155
  <p>
156
   Ant is a Java based build application similar to Make on UNIX systems.  
157
   It takes in installation parameters from a file in the root installation
158
   directory named "build.xml".  The Metacat CVS module contains a default
159
   build.xml file that may require some modification upon installation.  Ant
160
   should be installed on the system and the "ant" executable shell script 
161
   should be available in the users path. The latest metacat release was tested with 
162
   Ant 1.6.5. <!-- We note that the current build is 
163
   not working with Ant 1.6.x, so you'll need to use an earler version.  We have 
164
   successfully used Ant 1.5.1, 1.5.2, and some earlier versions. -->
165
  </p>
166
  <p class="header">Tomcat</p>
167
  <p>
168
    Install Tomcat into the directory of your choice. The directory in which 
169
    you install Tomcat itself will be referred to as the "$CATALINA_HOME".
170
    We recommend that you install Tomcat version 5.5.  More details about 
171
    Tomcat installation are available <a href=" http://jakarta.apache.org/tomcat/index.html">here</a>.
172
  </p>
173
 </td>
174
</tr>
175
</table>
176

    
177
<table class="tabledefault" width="100%">
178
<td class="tablehead" colspan="2"></td>
179
<tr>
180
<td>
181
  <p>
182
   Once all of the prerequisite software is installed as described above, 
183
   the installation of Metacat can begin.  First you must have a current
184
   version of the source distribution of Metacat.  You can get it two ways.
185
   Authorized users can check it out of the NCEAS 
186
   <a href="http://www.nceas.ucsb.edu/cgi-bin/cvsweb.cgi/xmltodb/">CVS</a>
187
   system. You'll need both the "metacat" module and the "utilities" module to
188
   be checked out in sibling directories. The command is as follows: 
189
   <pre>mkdir knb-software</pre>
190
   <pre>cd knb-software</pre>
191
   <pre>cvs checkout -P metacat</pre>
192
   <pre>cvs checkout -P utilities</pre>  
193
   Or you can 
194
   <a href="@server@/software/download.html">download</a> a gzipped tar file
195
   from this site.
196
  </p>
197
  <p>
198
  
199
  <h2>Edit <code>build.properties</code> File</h2></p>
200
  <p>
201
   Once you have either checked out or unzipped and untarred the source
202
   distribution, you can begin the installation process.  Change into the 
203
   metacat directory and edit the file called "<code>build.properties</code>".  You will need 
204
   to change a number of configuration properties to match the setup on
205
   your system.
206
  </p>
207
  <p>
208
  The properties that you will likely need to change will include:
209
  <ul>
210
  <li><code>tomcat</code></li>
211
  <li><code>deploy.dir</code></li>
212
  <li><code>tomcatversion</code></li>
213
  <li><code>metacat.context</code></li> 
214
  <li><code>config.hostname</code></li>
215
  <li><code>config.port</code></li>
216
  <li><code>config.port.https</code></li>
217
  <li><code>ldapUrl</code></li>
218
  <li><code>database</code></li>
219
  <li><code>jdbc-connect</code></li>
220
  <li><code>jdbc-base</code></li>
221
  <li><code>user</code></li>
222
  <li><code>password</code></li>
223
  <li><code>datafilepath</code></li>
224
  <li><code>inlinedatafilepath</code></li>
225
  <li><code>default-style</code></li>
226
  <li><code>administrators</code></li>
227
  <li><code>authority.context</code></li>
228
  <li><code>config.lsidauthority</code></li>
229
  </ul>
230

    
231
  Each is described in detail in the following table:
232
  </p>
233
  <br><br>
234
  <table border="1">
235
    <tr>
236
      <td><b>Property</b></td>
237
      <td><b>Description</b></td>
238
      <td><b>Default value and examples of other values</b></td>
239
    </tr>
240
    <tr>
241
      <td>tomcat</td>
242
      <td>The tomcat property is the location in which tomcat is installed.</td>
243
      <td>Default:&nbsp;&nbsp;
244
          <code>/usr/local/devtools/jakarta-tomcat</code>
245
      <br><br>Example:&nbsp;&nbsp;
246
          <code>C:/Tomcat-5.5</code></td>
247
    </tr>
248
    <tr>
249
      <td>deploy.dir</td>
250
      <td>The deploy.dir property is the location in which your tomcat servlet 
251
          contexts are deployed. This is typically "${tomcat}/webapps",
252
          where ${tomcat} is the same value that you entered for the 'tomcat'
253
          property above.
254
      </td>
255
      <td>Default:&nbsp;&nbsp;
256
          <code>/var/www/org.ecoinformatics.knb</code>
257
      <br><br>Example:&nbsp;&nbsp;
258
          <code>C:/Tomcat-5.5/webapps</code>
259
      </td>
260
    </tr>
261
    <tr>
262
      <td>tomcatversion</td>
263
      <td>The tomcatversion property is the version of tomcat in which you 
264
          want Metacat to run. This will determine the location of some
265
          jar files coming with tomcat.</td>
266
      <td>Default:&nbsp;&nbsp;
267
          <code>tomcat5</code>
268
      <br><br>Example:&nbsp;&nbsp;
269
          <code>tomcat4</code>
270
      </td>
271
    </tr>
272
    <tr>
273
      <td>metacat.context</td>
274
      <td>The metacat.context property is the name of the servlet context in which you 
275
          want Metacat to be installed. This will determine the installation 
276
          directory for the servlet and many of the URLs that are used to access
277
          the installed Metacat server.</td>
278
      <td>Default:&nbsp;&nbsp;
279
          <code>knb</code>
280
      <br><br>Example:&nbsp;&nbsp;
281
          <code>mycontext</code>
282
      </td>
283
    </tr>
284
    <tr>
285
      <td>config.hostname</td>
286
      <td>The config.hostname property is the hostname of the server on which Metacat is 
287
          running (note that you should not include the 'http://' in the config.hostname
288
          property).
289
      </td>
290
      <td>Default:&nbsp;&nbsp;
291
         <code>knb.ecoinformatics.org</code>
292
      <br><br>Example:&nbsp;&nbsp;
293
         <code>somehost.university.edu</code>
294
      </td>
295
    </tr>
296
    <tr>
297
      <td>config.port</td>
298
      <td>The config.port property is the HTTP plain port number that is used to connect to Metacat.
299
          If Tomcat is running stand-alone, the value will typically be 8080.</td>
300
      <td>Default:&nbsp;&nbsp;
301
          <code>80</code>
302
      <br><br>Example:&nbsp;&nbsp;
303
          <code>8080</code>
304
      </td>
305
    </tr>
306
    <tr>
307
      <td>config.port.https</td>
308
      <td>The config.port.https property is the HTTP secure port number that is used to connect to Metacat,
309
          generally when replicating documents to and from other Metacat servers.
310
          If Tomcat is running stand-alone, the value will typically be 8443.</td>
311
      <td>Default:&nbsp;&nbsp;
312
          <code>443</code>
313
      <br><br>Example:&nbsp;&nbsp;
314
          <code>8443</code>
315
      </td>
316
    </tr>
317
    <tr>
318
      <td>ldapUrl</td>
319
      <td>URL to the LDAP server. The LDAP server is used in the default
320
          authentication module to authenticate and identify users of the
321
          system.  To participate in the KNB network, you should leave this at
322
          the default.  But it can be changed if you want to use a 
323
          different directory of users.
324
      </td>
325
      <td>Default:&nbsp;&nbsp;
326
          <code>ldap://ldap.ecoinformatics.org/dc=ecoinformatics,dc=org</code>
327
      </td>
328
    </tr>
329
    <tr>
330
      <td>database</td>
331
      <td>Select the database to use for metadata storage.
332
          Valid values are <code>oracle</code>, <code>postgresql</code>, or
333
          <code>sqlserver</code>. <em>Note that sqlserver support is minimal and
334
          probably will not work without substantial changes on your part,
335
          possibly including code changes.  We have not recently tested on 
336
          sqlserver.</em>
337
      </td>
338
      <td>Default:&nbsp;&nbsp;
339
          <code>postgresql</code>
340
      <br><br>Other possible values:&nbsp;&nbsp;
341
          <code>oracle</code>&nbsp;&nbsp;
342
          <code>sqlserver</code>
343
      </td>
344
    </tr>
345
    <tr>
346
      <td>jdbc-connect</td>
347
      <td>The JDBC connection string used to connect to the database.</td>
348
      <td>Default:&nbsp;&nbsp;
349
          <code>jdbc-connect=jdbc:postgresql://localhost/metacat</code>
350
      <br><br>Example:&nbsp;&nbsp;
351
          <code>jdbc:oracle:thin:@somehost.university.edu:1521:metacat</code>
352
      </td>
353
    <tr>
354
      <td>jdbc-base</td>
355
      <td>The base directory for locating JDBC jar files. When using the postgresql database, the default setting of './lib' can be used,
356
          while oracle and sqlserver databases will require a different setting since these jar files are not included in the Metacat
357
          distribution.</td>
358
      <td>Default:&nbsp;&nbsp;
359
          <code>./lib</code>
360
      <br><br>Example:&nbsp;&nbsp;
361
          <code>/usr/oracle/jdbc/lib</code><br>
362
      </td>
363
    </tr>
364
    <tr>
365
      <td>user</td>
366
      <td>The database user name that you set up to use Metacat.</td>
367
      <td>Default:&nbsp;&nbsp;
368
          <code>metacat</code>
369
      <br><br>Example:&nbsp;&nbsp;
370
          <code>metacatuser</code>
371
      </td>
372
    </tr>
373
    <tr>
374
      <td>password</td>
375
      <td>The database password that you set up to use Metacat.</td>
376
      <td>Default:&nbsp;&nbsp;
377
          <code>yourPasswordHere</code>
378
      <br><br>Example:&nbsp;&nbsp;
379
          <code>metacat123</code>
380
      </td>
381
    </tr>
382
    <tr>
383
      <td>datafilepath</td>
384
      <td>The datafilepath is the directory to store data files.</td>
385
      <td>Default:&nbsp;&nbsp;
386
          <code>/var/metacat/data</code>
387
      <br><br>Example:&nbsp;&nbsp;
388
          <code>C:/Tomcat-5.5/data/metacat/data</code>
389
      </td>
390
    </tr>
391
    <tr>
392
      <td>inlinedatafilepath</td>
393
      <td>The inlinedatafilepath is the directory to store inline data that
394
          has been extracted from EML documents.</td>
395
      <td>Default:&nbsp;&nbsp;
396
          <code>/var/metacat/inline-data</code>
397
      <br><br>Example:&nbsp;&nbsp;
398
          <code>C:/Tomcat-5.5/data/metacat/inlinedata</code>
399
      </td>
400
    </tr>
401
    <tr>
402
      <td>default-style</td>
403
      <td>The default-style parameter defines the "style-set" that is to be used
404
          by default when the qformat parameter is missing or set to "html"
405
          during a query. It is set to "default", which is one of the styles that 
406
          ships with the default metacat distribution. Other possible settings
407
          are shown in the examples to the right.</td>
408
      <td>Default:&nbsp;&nbsp;
409
          <code>default</code>
410
      <br><br>Examples:<code>esa kepler knb knb2 knp lter ltss nceas nrs obfs pisco specnet</code>
411
      </td>
412
    </tr>
413
    <tr>
414
      <td>administrators</td>
415
      <td>The administrators parameter lists the accounts that are allowed to
416
          perform administrative actions such as rebuilding indices for 
417
          documents. The list can contain more than one account separated
418
          by colons.</td>
419
      <td>Default:&nbsp;&nbsp;
420
          <code>uid=jones,o=NCEAS,dc=ecoinformatics,dc=org</code>
421
      <br><br>Examples:&nbsp;&nbsp;
422
          <code>uid=localadmin,o=ucnrs.org</code>
423
      </td>
424
    </tr>
425
	
426
	<!-- start lsid stuff -->
427
	<tr>
428
      <td>authority.context</td>
429
      <td>This is the context for the (Life Sciences Identifier) LSID authority.
430
        LSID support is an optional feature which can be configured to provide
431
        metacat access to LSID clients. For more information on LSID's see <a href="http://wiki.gbif.org/guidwiki/wikka.php?wakka=LSID">TDWG
432
        site</a>.</td>
433
      <td>Default: authority</td>
434
    </tr>
435
	<tr>
436
      <td>config.lsidauthority</td>
437
      <td>This is the name of the LSID authority that this metacat should use.
438
        This authority needs to be defined as SRV record in a DNS.</td>
439
      <td><p>Default: ecoinformatics.org</p>
440
        <p>Examples: esa.org or sulphur.ecoinformatics.org</p></td>
441
    </tr>
442
  </table>
443
  <br>
444
  <p>
445
   Note that the build file is preconfigured to install Metacat either using 
446
   Oracle, PostgreSQL, or Microsoft SQL Server as a backend database.  
447
   To change the database system, simply change the value of the 'database' 
448
   property to be the name of the database target that you wish to use 
449
   (either 'oracle', 'postgresql', or 'sqlserver').
450
  </p>
451
  Other properties in <code>build.properties</code> that you can (but generally need not) change:<br />
452
  <br>
453
  <table border="1">
454
    <tr>
455
      <td><b>Property</b></td>
456
      <td><b>Description</b></td>
457
      <td><b>Default value and examples of other values</b></td>
458
    </tr>
459
    <tr>
460
      <td>server</td>
461
      <td>The server property is the hostname and port number of the server that Metacat uses
462
          for replicating documents to and from other Metacat servers, which should be with the secure (HTTPS) port.
463
          Since this property is usually composed of the <code>config.hostname</code> and <code>config.port.https</code> properties (described above),
464
          the default setting can be used in most cases.
465
      <td>Default:&nbsp;&nbsp;<code>${config.hostname}:${config.port.https}</code>
466
      </td>
467
    </tr>
468
    <tr>
469
      <td>httpserver</td>
470
      <td>httpserver is the plain HTTP address and port number that Metacat uses for purposes
471
          other than replication. Since this property is usually composed of the <code>config.hosthame</code> and <code>config.port</code>
472
          properties (described above), the default setting can be used in most cases.</td>
473
      <td>Default:&nbsp;&nbsp;<code>${config.hostname}:${config.port}</code>
474
      </td>
475
    </tr>
476
    <tr>
477
      <td>inst.cgi.dir</td>
478
      <td>Installation directory for registry CGI scripts</td>
479
      <td>Default:&nbsp;&nbsp;
480
          <code>/var/www/cgi-knb</code>
481
      </td>
482
    </tr>
483
    <tr>
484
      <td>cgi-prefix</td>
485
      <td>&nbsp;</td>
486
      <td>Default:&nbsp;&nbsp;
487
          <code>http://${httpserver}/cgi-bin</code>
488
      </td>
489
    </tr>
490
    <tr>
491
      <td>cvsroot</td>
492
      <td>CVS access to retrieve latest EML. Only used by
493
          developers in building the release.</td>
494
      <td>Default:&nbsp;&nbsp;
495
          <code><pre>:ext:${env.USER}@cvs.ecoinformatics.org:/cvs</pre></code>
496
          Example:&nbsp;&nbsp;
497
          <code><pre>:ext:myaccount@cvs.ecoinformatics.org:/cvs</pre></code>
498
      </td>
499
    </tr>
500
    <tr>
501
      <td>knb-site-url</td>
502
      <td>This is the URL to the web context root for the knb site. 
503
          It is used for the qformat=knb skin only.</td>
504
      <td>Default:&nbsp;&nbsp;
505
          <code>http://knb.ecoinformatics.org</code>
506
      </td>
507
    </tr>
508
    <tr>
509
      <td>timedreplication</td>
510
      <td>Determines whether timed replication to other metacat servers is being used.</td>
511
      <td>Default:&nbsp;&nbsp;
512
          <code>false</code>
513
      <br><br>Other possible values:&nbsp;&nbsp;
514
          <code>true</code>
515
      </td>
516
    </tr>
517
    <tr>
518
      <td>firsttimedreplication</td>
519
      <td>The time for starting first timed replication if timedreplication is true.
520
          (See comments in build.properties file for additional details.)</td>
521
      <td>Default:&nbsp;&nbsp;
522
          <code>10:00 PM</code>
523
          <code>&nbsp;</code>
524
      </td>
525
    </tr>
526
    <tr>
527
      <td>timedreplicationinterval</td>
528
      <td>The interval to next timed replication if timedreplication is true.
529
          The value is in milliseconds and default value is 48 hours.</td>
530
      <td>Default:&nbsp;&nbsp;
531
          <code>172800000</code>
532
          <code>&nbsp;</code>
533
      </td>
534
    </tr>
535
    <tr>
536
      <td>forcereplicationwaitingtime</td>
537
      <td>The waiting time before replication is forced to begin after
538
          uploading a package. The default value should usually suffice.</td>
539
      <td>Default:&nbsp;&nbsp;
540
          <code>30000</code>
541
          <code>&nbsp;</code>
542
      </td>
543
    </tr>
544
  </table>
545
  <p>
546
  Metacat has a number of additional settable properties in file
547
  <code>lib/metacat.properties</code>. Under most circumstances,
548
  you will not need to modify this file because the properties of interest
549
  to you can be controlled by editing <code>build.properties</code> as
550
  described above. To learn more about Metacat's additional properties,
551
  see <a href="./properties.html">Metacat Properties File</a>.
552
  </p>
553
  <p class="emphasis">
554
   Note: When setting properties, DO NOT add a trailing slash [/] to the end of any paths that are specified.
555
   Metacat will not function correctly if you do so.
556
  </p>
557

    
558
</td>
559
</tr>
560
</table>
561

    
562
<table class="tabledefault" width="100%">
563
<td class="tablehead" colspan="2"><p><h2>Compilation and Installation</h2></p></td>
564
<tr>
565
<td>
566
  <a name="protocol"></a>
567
  <p>
568
   Ant allows compilation and installation to be done in one step.
569
   Change into the metacat directory and type: 
570
   <pre><b>ant install</b></pre>
571
   or, if you are upgrading an existing installation, type:
572
   <pre><b>ant clean upgrade</b></pre>
573
   <p>
574
   You should see a bunch of messages telling you the progress of compilation
575
   and installation.  When it is done you should see the message 
576
   BUILD SUCCESSFUL
577
   and you should be returned to a UNIX command prompt.  If you do not see
578
   the message BUILD SUCCESSFUL then there was an error that you need to 
579
   resolve.
580
   This may come up if you are logged in as a user that does not have write
581
   access to one or more of the directories that are listed in the build.xml
582
   file, or if any of the paths to files are not configured correctly in the
583
   "config" target.
584
  </p>
585
  <p>
586
  Note: The 'data' directories that are indicated in the 'datafilepath' and
587
  'inlinedatafilepath' build properties must be writeable
588
  by user account under which Tomcat runs or you will not be able to upload 
589
  data files to the system.
590
  </p>
591

    
592
  <p class="header">To install metacat LSID support, adjust the LSID-related
593
    properties in the build.properties files and type:
594
  <p class="header"><b>ant deploy-lsid</b>
595
  <p class="header">    
596
  <h2>SQL Scripts</h2></p>
597
  <p>
598
   You now need to set up the table structure in your database.  You can do
599
   either do this using the ant build system, or by manually running the
600
   scripts using a sql utility.
601
  </p>
602
  <p><b>WARNING: Do NOT run this on an existing metacat installation as it
603
  will delete all of your data.  If you have an existing metacat installation,
604
  see the instructions for "Upgrading" below.</b></p>
605

    
606
  <p>To run the scripts using ant, type <code>ant installdb</code>.  This does 
607
  not work for postgres, so you'll need to run the xmltables-postgres.sql script 
608
  manually (see next paragraph).
609
  </p>
610
  <p>To run the scripts manually, change to the
611
   metacat/build/src directory.  Then run you RDBMS's SQL utility.  In Oracle it is
612
   SQLPlus.  This tutorial assumes an Oracle database so this example is for
613
   SQLPlus.  Login as the oracle user that was set up for use with Metacat.
614
   At the SQLPlus prompt type the following: <pre><b>@xmltables.sql;</b></pre>
615
   For postgres, use a command like: 
616
   <code>psql -U metacat -W -h localhost -f build/src/xmltables-postgres.sql metacat</code>
617
  </p>
618
  <p>Either way, 
619
   you should see a bunch of output showing the creation of the Metacat table
620
   space. The first time you run this script you will get several errors at the 
621
   beginning saying that you cannot drop a table/index/trigger because it 
622
   does not exist.  This is normal.  Any other errors besides this need to be
623
   resolved before continuing. The script file name for PostgreSQL is 
624
   xmltables-postgres.sql and for Microsoft SQL server is 
625
   xmltables-sqlserver.sql.
626
  </p>
627
  <p>
628
   If the script has run correctly you should be able to type 
629
   <pre>describe xml_documents</pre> and it should show:
630
   <pre>
631
    Name            Null?         Type
632
    --------------  ------------  ---------------- 
633
     DOCID          NOT NULL      VARCHAR2(250)
634
     ROOTNODEID                   NUMBER(20)
635
     DOCNAME                      VARCHAR2(100)
636
     DOCTYPE                      VARCHAR2(100)
637
     DOCTITLE                     VARCHAR2(1000)
638
     USER_OWNER                   VARCHAR2(100)
639
     USER_UPDATED                 VARCHAR2(100)
640
     SERVER_LOCATION              NUMBER(20)
641
     REV                          NUMBER(10)
642
     DATE_CREATED                 DATE
643
     DATE_UPDATED                 DATE
644
     PUBLIC_ACCESS                NUMBER(1)
645
     UPDATED                      NUMBER(1)
646
   </pre>
647
  </p>
648
  <p class="header"><h2>Registering schemas and DTDs</h2></p>
649
  <p>Once the tables have been created, you should also register the Ecological
650
  Metadata Language (EML) DTDs and schemas. <b>However, note that you should 
651
  NOT do this if you are upgrading an existing installation -- the upgrade
652
  scripts take care of it for you (see the next section).</b>  If you are
653
  installing new, you can register the schema documents by running:</p>
654
  <pre><b>ant register-schemas</b></pre> 
655
  <p>This command registers the EML DTDs' and schemas' location in the 
656
  metacat server.  Your database username and password have to be set correctly
657
  for this to work.  Also, if for some reason running this script from ant
658
  does not work, you could instead try running "build/src/loaddtdschema.sql"
659
  from your sql utility (but be sure to use the version in the 'build' directory
660
  that has been customized for your installation).
661
  </p>
662
  <p class="header"><h2>Upgrading SQL Scripts</h2></p>
663
  <p>
664
    If you have an existing metacat installation, you should not run the install
665
    script because it will replace all of the older tables with new, empty 
666
    copies of the tables.  Thus you would lose your data!  Instead, you can 
667
    run some upgrade scripts that will change the table structure as needed for
668
    the new version.  If you are skipping versions, run each upgrade script
669
    for the intermediate versions as well.  Currently the upgrade scripts are:
670
   </p>
671
    <ul>
672
      <li>build/src/upgrade-db-to-1.2.sql</li>
673
      <li>build/src/upgrade-db-to-1.3.sql</li>
674
      <li>build/src/upgrade-db-to-1.4.sql</li>
675
      <li>build/src/upgrade-db-to-1.5.sql</li>
676
      <li>build/src/upgrade-db-to-1.6.sql</li>
677
      <li>build/src/upgrade-db-to-1.7.sql</li>
678
      <li>build/src/upgrade-db-to-1.7.1.sql</li>
679
    </ul>
680
   <p>
681
    For example, if you had an existing metacat 1.4 installation and you were upgrading 
682
    to metacat 1.7, you would need to run three scripts in sequence:
683
    upgrade-db-to-1.5.sql, upgrade-db-to-1.6.sql, and upgrade-db-to-1.7.sql. 
684
    However, if you were starting from a Metacat 1.6
685
    installation, you would only need to run the upgrade-db-to-1.7.sql script.
686
    <em>Be sure to use the version of the scripts from the 'build/src' directory: they
687
    are customized for your installation in that directory.</em>
688
   </p>
689
  </p>
690
  <h2>Restart Tomcat</h2>
691
  <p>
692
   Once you have successfully installed Metacat, there is one more step.  Tomcat
693
   (and Apache if you have Tomcat integrated with it) must be restarted.  To do
694
   this, login as the user that runs your tomcat server (often "tomcat"),
695
   go to $CATALINA_HOME/bin and type:
696
   <pre>
697
   ./shutdown.sh 
698
   ./startup.sh 
699
   </pre>
700
   In the Tomcat startup messages you should see something in log file like:
701
   <pre>
702
    MetacatServlet Initialize
703
    Context log path="/metadata" :Metacat: init
704
    MetacatServlet Initialize
705
   </pre>
706
   If you see that message Tomcat is successfully loading the Metacat servlet.
707
   Next, try to run your new servlet.  Go to a web browser and type:
708
   <pre>http://yourserver.yourdomain.com/yourcontext/</pre>
709
   You should substitute your context name for "yourcontext" in the url above.
710
   If everything is working correctly, you should see a query page followed
711
   by an empty result set.  Note that if you do not have Tomcat integrated with
712
   Apache you will probably have to type
713
   <pre>http://yourserver.yourdomain.com:8080/yourcontext/</pre>
714
  </p>
715
  <p><b>Troubleshooting</b>: If you see something like java.lang.InternalError: 
716
  Can't connect to X11 window server using 'yourservanme:0.0' as the value of the DISPLAY variable.
717
  <p>You should add this line: 
718
  <b>JAVA_OPTS="-Djava.awt.headless=true $JAVA_OPTS"</b> at the first line of
719
  catalina.sh file in tomcat bin directory. The reason is that GeoServer uses X11 windows to draw graphics.
720
  </p>
721

    
722
  <h2> Operating System Specific Instructions </h2>
723
  <p> These documents are meant to outline the metacat installation process on specific platforms. They are <strong><em>not</em></strong> a substitute for the above instructions and only meant as a supplemental guideline. </p>
724
  <ul>
725
    <li> <a href="os_specific/install_metacat_windows.txt">Installing from CVS source on Windows XP</a> </li>
726
    <li> <a href="os_specific/install_metacat_ubuntu.txt">Installing from CVS source on Ubuntu 6.06 (ie Dapper Drake)</a> </li>
727
    <li> <a href="os_specific/install_metacat_mac.txt">Installing from CVS source on Mac OSX (Intel)</a> </li>
728
  </ul>
729
</td>
730
</tr>
731
</table>
732

    
733
</body>
734
</html>
(29-29/52)