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: daigle $'
9
  *    '$Date: 2008-12-26 16:30:46 -0800 (Fri, 26 Dec 2008) $'
10
  *    '$Revision: 4716 $'
11
  *
12
  *
13
  -->
14
  
15
<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.0//EN">
16
<html>
17

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

    
24
<body>
25

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

    
44
<div class="header1">Table of Contents</div>
45
  <div class="toc">
46
    <div class="toc1"><a href="#Intro">Introduction</a></div> 
47
      <div class="toc2"><a href="#DifferentOptions">Different Installation Options</a></div> 
48
      <div class="toc2"><a href="#ThisDoc">Organization Of This Page</a></div>
49
    <div class="toc1"><a href="#QuickInstallation">Quick Installation</a></div> 
50
      <div class="toc2"><a href="#DownloadMetacatInstall">Download Metacat Package</a></div> 
51
      <div class="toc2"><a href="#CreateDirs">Create Metacat Directories</a></div> 
52
      <div class="toc2"><a href="#InstallJava">Install Java</a></div> 
53
      <div class="toc2"><a href="#InstallApache">Install Apache</a></div> 
54
      <div class="toc2"><a href="#InstallTomcat">Install Tomcat</a></div> 
55
      <div class="toc2"><a href="#InstallPostgres">Install PostgreSQL Database</a></div> 
56
      <div class="toc2"><a href="#QuickInstallMetacatWar">Install Metacat War</a></div> 
57
      <div class="toc2"><a href="#QuickInstallLsidWar">Install LSID War</a></div> 
58
      <div class="toc2"><a href="#ConfigureMetacatInstall">Configure Metacat</a></div> 
59
    <div class="toc1"><a href="#QuickUpdate">Quick Update</a></div>
60
      <div class="toc2"><a href="#DownloadMetacatUpdate">Download Metacat Package</a></div> 
61
      <div class="toc2"><a href="#BackupApplication">Backup Existing Metacat Installation</a></div> 
62
      <div class="toc2"><a href="#QuickUpdateMetacatWar">Update Metacat War</a></div> 
63
      <div class="toc2"><a href="#QuickUpdateLsidWar">Update LSID War</a></div> 
64
      <div class="toc2"><a href="#ConfigureMetacatUpdate">Configure Metacat</a></div> 
65
    <div class="toc1"><a href="#PreInstallation">Pre-Installation</a></div>
66
      <div class="toc2"><a href="#MinRequirements">Minimum Requirements</a></div> 
67
      <div class="toc2"><a href="#AdditionalRequiredSoftware">Additional Required Software</a></div>
68
    <div class="toc1"><a href="#AdditionalSoftwareSetup">Additional Software Setup</a></div>
69
      <div class="toc2"><a href="#AdditionalSoftwareJava">Java</a></div> 
70
      <div class="toc2"><a href="#AdditionalSoftwareOracle">Oracle</a></div>
71
      <div class="toc2"><a href="#AdditionalSoftwarePostgreSQL">PostgreSQL</a></div>
72
      <div class="toc2"><a href="#AdditionalSoftwareAnt">Ant</a></div>
73
      <div class="toc2"><a href="#AdditionalSoftwareTomcat">Tomcat</a></div>
74
    <div class="toc1"><a href="#DownloadingMetacat">Download Metacat and Get War File</a></div>
75
      <div class="toc2"><a href="#DownloadMetacatBinary">Download Metacat Binary and Get War File</a></div>
76
      <div class="toc2"><a href="#DownloadMetacatSourceDist">Download Metacat Source Distribution</a></div>
77
      <div class="toc2"><a href="#DownloadMetacatSourceSVN">Download Metacat Source From SVN</a></div>
78
      <div class="toc2"><a href="#CreateSourceWar">Create War From Source</a></div>
79
    <div class="toc1"><a href="#InstallingMetacat">Installing Metacat</a></div>
80
      <div class="toc2"><a href="#CreateMetacatDirs">Create Metacat Directories</a></div>
81
      <div class="toc2"><a href="#InstallMetacatWar">Install Metacat Binary (War)</a></div>
82
      <div class="toc2"><a href="#InstallMetacatSource">Install Metacat From Source</a></div>
83
    <div class="toc1"><a href="#UpgradingMetacat">Upgrading Existing Metacat</a></div>
84
      <div class="toc2"><a href="#UpgradeStopMetacat">Stop the Running Metacat</a></div>
85
      <div class="toc2"><a href="#UpgradeDownloadMetacat">Download Latest Metacat Application</a></div>
86
      <div class="toc2"><a href="#UpgradeMetacatWar">Upgrade Metacat Binary (War)</a></div>
87
      <div class="toc2"><a href="#UpgradeMetacatSource">Upgrade Metacat From Source</a></div>
88
   <div class="toc1"><a href="#RestartTomcat">Restart Tomcat</a></div>
89
      <div class="toc2"><a href="#UpgradeTroubleshooting">Troubleshooting</a></div>
90
      <div class="toc2"><a href="#UpgradeConfigureMetacat">Configure Metacat</a></div>       
91
    <div class="toc1"><a href="#Registry">Web Based Registry</a></div>
92
  </div> 
93

    
94
<a name="Intro"></a><div class="header1">Introduction</div>
95
  <a name="DifferentOptions"></a><div class="header2">Different Installation Options</div>
96
  <p>There are many different options to consider when installing Metacat.  Some of these
97
  are: </p>
98
  <ul>
99
  <li>Operating System - Metacat is a Java servlet application.  As such, you can run
100
  it on many different operating system.  It has been tested against Linux, MacOS and 
101
  MicroSoft Windows.  The optimal installation is on Ubuntu Linux.</li>
102
  <li>Tomcat standalone or in conjunction with Apache web server - The Tomcat server 
103
  can be run alone as a web server.  However, it is not as robust a server,
104
  and does't allow for the same level of customization as Apache.  The recommended 
105
  configuration is Tomcat running in conjunction with Apache</li>
106
  <li>Binary versus source installation - There are three ways to get and install 
107
  the Metacat installation.
108
    <ul>
109
  	<li>Binary Distribution Installation - download the Metacat war distribution and install it 
110
  	into the web applications directory</li>
111
  	<li>Source Distribution Installation - download the source code distribution, build it and 
112
  	install the resultant war file into the web application directory.</li>
113
  	<li>Source Checkout Installation - check the source code out from the Subversion 
114
  	repository, build it and install the resultant war file into the web application directory.</li>
115
  	</ul>
116
  The recommended installation procedure is binary distribution installation.</li>
117
  </ul>
118
  
119
  <p>The administrator will need to decide which combinations of these option are best
120
  suited to their system</p>
121
  
122
  <a name="ThisDoc"></a><div class="header2">Organization Of This Page</div>
123
  <p> The first couple of sections on this page deal with quick command line 
124
  instructions for installing and upgrading Metacat in the optimal environment, which
125
  is a binary distribution installation with Apache on Ubuntu Linux.</p>
126
  
127
  <p>The remainder of the page deals with more detailed instructions including other 
128
  installation options.</p>
129

    
130
<a name="QuickInstallation"></a><div class="header1">Quick Installation</div>
131
  <p>These are the installation instructions for a system that has Ubuntu 8.04 installed
132
  and has never had Metacat installed on it:</p>
133
 
134
  <a name="DownloadMetacatInstall"></a><div class="header2">Download Metacat Package</div>
135
    <ul>
136
    <li>Browse to the 
137
      <a href="http://knb.ecoinformatics.org/software/download.html">KNB Software Download Page</a>.
138
      In the Metacat section, select the link that looks like:
139
	  <div class="code">metacat-bin-X.X.X.tar.gz</div>
140
    where X.X.X is the latest version of Metacat.  Choose to save the file locally.</li>
141
    <li>Extract the Metacat package files by typing:
142
      <div class="code">tar -xvzf metacat-bin-X.X.X.tar.gz</div></li>
143
    <li>You should see a war file and several supporting files.  The location where these files
144
    were extracted will be refered to as the the &lt;metacat_package_dir&gt; for the remainder 
145
    of this documentation.</li>
146
    </ul>
147
  
148
  <a name="CreateDirs"></a><div class="header2">Create Metacat Directories</div>
149
    <ul>
150
    <li>Create the metacat utility base directory by typing:
151
      <div class="code">sudo mkdir /var/metacat</div>
152
	  <div class="code">sudo chown -R &lt;tomcat_user&gt; /var/metacat</div>
153
    where &lt;tomcat_user&gt; is the user that will start Tomcat.  If you are 
154
	starting Tomcat as the root user, you do not need to run the chown command.</li>
155
    </ul>
156

    
157
  <a name="InstallJava"></a><div class="header2">Install Java</div>
158
    <ul>
159
    <li>Install Java by typing:
160
      <div class="code">sudo apt-get install sun-java5-jdk</div></li>
161
	<li>hit "ok" then "yes" for license agreement</li>
162
	</ul>
163

    
164
  <a name="InstallApache"></a><div class="header2">Install Apache</div>
165
    <ul>
166
    <li>Install Apache and and Mod JK packages by typing:	
167
      <div class="code">sudo apt-get install apache2 libapache2-mod-jk</div></li>
168
    <li>Set up Mod JK apache configuration by typing:
169
      <div class="code">sudo cp &lt;metacat_package_dir&gt;/jk.conf /etc/apache2/mods-available</div>
170
      <div class="code">sudo cp &lt;metacat_package_dir&gt;/workers.properties /etc/apache2</div></li>
171
    <li>Enable Apache Mod JK by typing:
172
      <div class="code">sudo a2dismod jk</div>
173
      <div class="code">sudo a2enmod jk</div></li>
174
    <li>Set up and enable knb (Metacat) site configurations by typing:
175
      <div class="code">sudo cp &lt;metacat_package_dir&gt;/knb /etc/apache2/sites-available</div>
176
      <div class="code">sudo a2ensite knb</div></li>
177
    <li>If you want to run an LSID server along with the Metacat server, set up and enable the authority service site 
178
      configurations by typing:
179
      <div class="code">sudo cp &lt;metacat_package_dir&gt;/authority /etc/apache2/sites-available</div>
180
      <div class="code">sudo a2ensite authority</div></li>
181
    <li>Restart apache to bring in changes by typing:
182
      <div class="code">sudo /etc/init.d/apache2 force-reload</div></li>
183
    </ul>
184
     
185
  <a name="InstallTomcat"></a><div class="header2">Install Tomcat</div>
186
    <ul>
187
    <li>Install Tomcat 5.5 by typing:
188
      <div class="code">sudo sudo apt-get install tomcat5.5</div> </li>
189
    <li>Install Metacat friendly Tomcat startup script by typing:    
190
      <div class="code">sudo /etc/init.d/tomcat5.5 stop</div>    
191
      <div class="code">sudo mv /etc/init.d/tomcat5.5 /etc/init.d/tomcat5.5.bak</div>
192
      <div class="code">sudo cp &lt;metacat_package_dir&gt;/tomcat5.5 /etc/init.d/tomcat5.5</div>
193
      <div class="code">sudo chmod +x /etc/init.d/tomcat5.5</div></li>
194
    </ul>
195
    
196
  <a name="InstallPostgres"></a><div class="header2">Install PostgreSQL Database</div> 
197
    <ul>
198
    <li>Install PostgreSQL by typing:</p>
199
      <div class="code">sudo apt-get install postgresql</div></li>
200
    <li>Change to postgres user:
201
      <div class="code">sudo su - postgres</div></li>
202
    <li>Setup empty Metacat database instance editing the postgreSQL configuration file:  
203
      <div class="code">gedit /etc/postgresql/8.3/main/pg_hba.conf</div></li>
204
    and adding the following line:
205
      <div class="code">host metacat metacat 127.0.0.1 255.255.255.255 password</div></li>
206
    <li>Save the file, then create the metacat instance:
207
      <div class="code">createdb metacat</div></li>
208
    <li>Log into postgreSQL by typing:
209
	  <div class="code">psql metacat</div>
210
	and create the metacat user by typing at the psql prompt:
211
	  <div class="code">CREATE USER metacat WITH UNENCRYPTED PASSWORD 'your_password';</div>
212
	where your_password is whatever password you would like for the metacat user.</li>
213
	<li>Exit PostgreSQL by typing
214
	  <div class="code">\q</div></li>
215
	<li>Restart the PostgreSQL database to bring in changes:
216
	  <div class="code">/etc/init.d/postgresql-8.3 restart</div></li>
217
	<li>Log out of the postgres user account by typing:
218
	  <div class="code">logout</div></li>
219
	<li>Test the installation and metacat account by typing:
220
	  <div class="code">psql -U metacat -W -h localhost metacat</div></li>
221
	<li>Log back out of postgreSQL:
222
	  <div class="code">\q</div></li>
223
	</ul>
224
	
225
  <a name="QuickInstallMetacatWar"></a><div class="header2">Install Metacat War</div> 
226
    <ul>
227
    <li>Copy the war file to Tomcat:
228
	  <div class="code">sudo cp &lt;metacat_package_dir&gt;/knb.war /usr/share/tomcat5.5/webapps</div></li>
229
	<li>Restart Tomcat:
230
	  <div class="code">sudo /etc/init.d/tomcat5.5 restart</div></li>
231
  	</ul>
232
  	
233
  <a name="QuickInstallLsidWar"></a><div class="header2">Install LSID War</div> 
234
    <ul>
235
    <li>If you want to run an LSID server along with the Metacat server, copy the 
236
    authority.war file to Tomcat:
237
	  <div class="code">sudo cp &lt;metacat_package_dir&gt;/authority.war /usr/share/tomcat5.5/webapps</div></li>
238
	<li>Restart Tomcat:  
239
	  <div class="code">sudo /etc/init.d/tomcat5.5 restart</div></li>
240
	</ul>
241
		
242
  <a name="ConfigureMetacatInstall"></a><div class="header2">Configure Metacat</div> 
243
    <p>Refer to the documentation on <a href="./metacat-configure.html">Metacat Confguration</a>
244
    to complete your installation of Metacat.</p>
245
    
246
  <a name="QuickUpdate"></a><div class="header1">Quick Update</div>
247
  <p>These are the instructions for a system that already has Metacat installed on it, 
248
  but needs a Metacat upgrade:</p>
249
  
250
  <a name="DownloadMetacatUpdate"></a><div class="header2">Download Metacat Package</div>
251
    <ul>
252
    <li>Browse to the 
253
      <a href="http://knb.ecoinformatics.org/software/download.html">KNB Software Download Page</a>.
254
      In the Metacat section, select the link that looks like:
255
	  <div class="code">metacat-bin-X.X.X.tar.gz</div>
256
    where X.X.X is the latest version of Metacat.  Choose to save the file locally.</li>
257
    <li>Extract the Metacat package files by typing:
258
      <div class="code">tar -xvzf metacat-bin-X.X.X.tar.gz</div>
259
    You should see a war file and several supporting files.  The location where these files
260
    were extracted will be refered to as the the &lt;metacat_package_dir&gt; for the remainder 
261
    of this documentation.</li>
262
    </ul>
263
    
264
  <a name="BackupApplication"></a><div class="header2">Backup Existing Metacat Installation</div>
265
    <ul>
266
    <li>To be safe, it is best to backup the existing Metacat installation.  Do so by typing: </p>
267
	  <div class="code">cp &lt;web_app_dir&gt;/knb &lt;web_app_dir&gt;/knb.&lt;yyyymmdd&gt;</div>
268
	  <div class="code">cp &lt;web_app_dir&gt;/knb.war &lt;web_app_dir&gt;/knb.war.&lt;yyyymmdd&gt;</div>
269
	Of course, you can use any backup strategy you like (or none at all).</p>
270
	</ul>
271
  
272
  <a name="QuickUpdateMetacatWar"></a><div class="header2">Update Metacat War</div> 
273
    <ul>
274
    <li>Copy the war file to Tomcat:
275
	  <div class="code">sudo cp knb.war /usr/share/tomcat5.5/webapps</div></li>
276
	<li>Restart Tomcat:  
277
	  <div class="code">sudo /etc/init.d/tomcat5.5 restart</div></li>
278
	</ul>
279
  	
280
  <a name="QuickUpdateLsidWar"></a><div class="header2">Update LSID War</div> 
281
    <ul>
282
    <li>If you want to run an LSID server along with the Metacat server, copy the 
283
    authority.war file to Tomcat:
284
	  <div class="code">sudo cp &lt;metacat_package_dir&gt;/authority.war /usr/share/tomcat5.5/webapps</div></li>
285
	<li>Restart Tomcat:  
286
	  <div class="code">sudo /etc/init.d/tomcat5.5 restart</div></li>
287
	</ul>
288
		
289
  <a name="ConfigureMetacatUpdate"></a><div class="header2">Configure Metacat</div> 
290
    <p>Refer to the documentation on <a href="./metacat-configure.html">Metacat Confguration</a>
291
    to complete your installation of Metacat.</p>
292

    
293
<a name="PreInstallation"></a><div class="header1">Pre-Installation</div>
294
  <a name="MinRequirements"></a><div class="header2">Minimum Requirements</div> 
295
  <p>
296
   Installing Metacat requires a server running an SQL92 compliant database
297
   (Oracle 8i or Postgresql recommended) with at least 128MB RAM, and a Pentium III class
298
   processor or higher.  The amount of disk space required depends on the
299
   size of your RDBMS tablespace (which should be at least 10 MB, 
300
   however Metacat itself requires only about 1 MB of free space after 
301
   installation).  These instructions assume a Linux environment but may
302
   work on other UNIX type environments, however this has not been tested.
303
  </p>
304
  
305
  <a name="AdditionalRequiredSoftware"></a><div class="header2">Additional Required Software</div>
306
  <p>
307
   The server on which you wish to install Metacat must have the following
308
   software installed and running correctly before attempting to install
309
   Metacat.
310
   <ul>
311
     <li><a href="http://www.oracle.com">Oracle 8i</a> (or another SQL92
312
         compliant RDBMS like Postgres)</li>
313
     <li><a href="http://jakarta.apache.org/ant/index.html">Apache Jakarta-Ant</a>
314
     </li>
315
     <li><a href="http://jakarta.apache.org/tomcat/index.html">Apache Jakarta-Tomcat</a>
316
       <p class="emphasis">Note: For a more robust web serving environment, 
317
       Apache web server should
318
       be installed along with Tomcat and the two should be integrated
319
       as described on the Apache web site.</p>
320
     </li>
321
   </ul>
322
  </p>
323

    
324
<a name="AdditionalSoftwareSetup"></a><div class="header1">Additional Software Setup</div>
325
  <a name="AdditionalSoftwareJava"></a><div class="header2">Java</div>
326
  <p>You'll need a recent Java SDK; J2SE 1.4.2 or later is required.  The latest metacat release
327
  has been tested most extensively with <a href="http://java.sun.com/j2se/1.5.0/">J2SE 5.0</a>
328
  and this is the recommended version.
329
  Make sure that JAVA_HOME environment variable is properly set and that both
330
  java and javac are on your PATH. 
331
  </p>
332
  <a name="AdditionalSoftwareOracle"></a><div class="header2">Oracle 8i</div>
333
  <p>The Oracle RDBMS must be installed and running as a daemon on the system.
334
   In addition the JDBC listener must be enabled.  You can enable it by
335
   logging in as your Oracle user and typing the following:</p>
336
   
337
     <div class="code">lsnrctl start</div>
338
     
339
   <p>Your instance should have a table space of at least 5 MB (10 MB or higher 
340
   recommended).  You should also have a username specific to Metacat
341
   created and enabled.  This user must have most normal permissions 
342
   including CREATE SESSION, CREATE TABLE, CREATE INDEX, CREATE TRIGGER, 
343
   EXECUTE PROCEDURE, EXECUTE TYPE, etc.  If an action is unexplainably 
344
   rejected by Metacat it is probably because the user permissions are not
345
   correctly set.</p>
346
   
347
  <a name="AdditionalSoftwarePostgreSQL"></a><div class="header2">PostgreSQL</div>
348
  <p>PostgreSQL can be easily installed on most linux distributions and on
349
  Windows (using cygwin) and Mac OS X.  Using Fedora Core or RedHat Linux,
350
  you can install the rpms for postgres and then run </p>
351
  
352
    <div class="code">/etc/init.d/postgresql start</div> 
353
    
354
  <p>in order to start the database. 
355
  On Ubuntu and other Debian-based Linux distributions, you can use the apt-get command
356
  to install postgres: 
357
    <div class="code">sudo apt-get install postgresql-8.0</div> and 
358
  then run 
359
    <div class="code">/etc/init.d/postgresql-8.0 start</div> to start.
360
  
361
  This initializes the data files.  You need to do a bit of configuration
362
  to create a database and set up a user account and allow internet access
363
  via jdbc.  See the postgres documentation for this, but here is a quick 
364
  start:
365
  <ul>
366
     <li>Switch to the "postgres" user account 
367
       <div class="code">sudo su - postgres</div></li>
368
     <li>Edit "data/pg_hba.conf", adding the following line to the file:<br>
369
       <div class="code">host   metacat  metacat      127.0.0.1         255.255.255.255   password</div>
370
     If your host uses IPv6 addresses, you may need this line instead:
371
       <div class="code">host   metacat  metacat      ::1               ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff password</div></li>
372
     <li>If you are using Postgresql pre-8.0, you must edit the "data/postgres.conf" file and uncomment and edit the line
373
     starting with "tcpip_socket" so that it reads 
374
       <div class="code">tcpip_socket = true</div></li>
375
     <li>Create metacat database by typing: 
376
       <div class="code">createdb metacat</div></li>
377
     <li>Log in using the postgres account and create a new "metacat" user account by typing:
378
       <div class="code">psql metacat</div> 
379
     <ul>
380
        <li>In postgres, run <div class="code">CREATE USER metacat WITH UNENCRYPTED PASSWORD 'apasswordyoulike';</div></li>
381
        <li>This creates a new account called metacat on the database named metacat</li>
382
        <li>Note: there are many ways to do this, so others such as using 
383
        ENCRYPTED passwords will work fine.</li>
384
     </ul>
385
     </li>
386
     <li>Exit the postgres account back to root and restart the postgres 
387
     database by typing:
388
       <div class="code">/etc/init.d/postgresql restart</div></li>
389
     <li>Test logging into the postgres db using the metacat account with 
390
     the following command: 
391
       <div class="code">psql -U metacat -W -h localhost metacat</div></li>
392
  </ul>
393
  </p>
394
  
395
  <a name="AdditionalSoftwareAnt"></a><div class="header2">Ant</div>
396
  <p>
397
   Ant is a Java based build application similar to Make on UNIX systems.  
398
   It takes in installation parameters from a file in the root installation
399
   directory named "build.xml".  The Metacat CVS module contains a default
400
   build.xml file that may require some modification upon installation.  Ant
401
   should be installed on the system and the "ant" executable shell script 
402
   should be available in the users path. The latest metacat release was tested with 
403
   Ant 1.6.5. <!-- We note that the current build is 
404
   not working with Ant 1.6.x, so you'll need to use an earler version.  We have 
405
   successfully used Ant 1.5.1, 1.5.2, and some earlier versions. -->
406
  </p>
407
  
408
  <a name="AdditionalSoftwareTomcat"></a><div class="header2">Tomcat</div>
409
  <p>
410
    Install Tomcat into the directory of your choice. The directory in which 
411
    you install Tomcat itself will be referred to as the &lt;tomcat_home&gt;.
412
    We recommend that you install Tomcat version 5.5.  If you are running 
413
    Ubuntu/Debian, you can get Tomcat by typing:</p>
414
      <div class="code">sudo apt-get install tomcat5.5</div>
415
    Otherwise, you can get Tomcat from <a href=" http://jakarta.apache.org/tomcat/index.html">the Apache Tomcat page</a>.
416
  </p>
417

    
418
<a name="DownloadingMetacat"></a><div class="header1">Download Metacat and Get War File</div>
419
 <p>There are several ways to wind up with a Metacat war file, which is needed for 
420
 installation.  These are: </p>
421
    <ul>
422
      <li>Download Metacat binary distribution - which will have a pre-built war file.</li>
423
      <li>Download Metacat source distribution - which will then need to be built in order to create a war file.</li>
424
      <li>Download Metacat source from SVN - which will then need to be built in order to create a war file.</li>
425
    </ul>
426
  <p>Since downloading the binary distribution is the easiest and most common install, it
427
  will be discussed here in detail.  Links to source download/build instructions are also
428
  included in case you would like to go that route.</p>
429

    
430
<a name="DownloadMetacatBinary"></a><div class="header2">Download Metacat Binary and Get War File</div>
431
    <p>Browse to the 
432
      <a href="http://knb.ecoinformatics.org/software/download.html">KNB Software Download Page</a>.
433
      In the Metacat section, for Linux based systems, select the link that looks like:</p>
434
	  <div class="code">metacat-bin-X.X.X.tar.gz</div>
435
	  <p>for Windows systems, select the link that looks like:</p>
436
	  <div class="code">metacat-bin-X.X.X.zip</div>
437
    <p>where X.X.X is the latest version of Metacat.  Choose to save the file locally.</p>
438
    <p>Extract the Metacat package files on Linux systems by typing:
439
      <div class="code">tar -xvzf metacat-bin-X.X.X.tar.gz</div>
440
    <p>or, on Windows, use your system unzip utility to extract the zip file.</p>
441
    <p>You should see a war file and several supporting files.  The location where these files
442
    were extracted will be refered to as the the &lt;metacat_package_dir&gt; for the remainder 
443
    of this documentation.
444
    
445
<a name="DownloadMetacatSourceDist"></a><div class="header2">Download Metacat Source Distribution</div>	
446
  <p>To get the Metacat source distribution, browse to the 
447
      <a href="http://knb.ecoinformatics.org/software/download.html">KNB Software Download Page</a>.
448
      In the Metacat section, for Linux based systems, select the link that looks like:</p>
449
	  <div class="code">metacat-src-X.X.X.tar.gz</div>
450
	  <p>for Windows systems, select the link that looks like:</p>
451
	  <div class="code">metacat-src-X.X.X.zip</div>
452
    <p>where X.X.X is the latest version of Metacat.  Choose to save the file locally in the directory 
453
    where your source should live.</p>
454
    <p>Extract the Metacat package files on Linux systems by typing:
455
      <div class="code">tar -xvzf metacat-src-X.X.X.tar.gz</div>
456
    <p>or, on Windows, use your system unzip utility to extract the zip file.</p>
457
    <p>Rename the metacat-X.X.X directory to metacat.</p>
458
    <p>Note that you do not need to create the war file directly with a source installation
459
    since the Ant build file has an "install" target that will build and deploy the war
460
    for you.  See the <a href="#InstallingMetacat">Installing Metacat</a> for instructions.</p>
461

    
462
<a name="DownloadMetacatSourceSVN"></a><div class="header2">Download Metacat Source From SVN</div>
463
  <p>If you are checking out Metacat code from the SVN repository, you will need both 
464
  Subversion (SVN) and CVS clients installed and configured on your system.  Both are needed
465
  because, while Metacat has been migrated to SVN, some of its supporting libraries (eml, 
466
  utilities and seek) have not yet been migrated.  Eventually, SVN will be the only versioning 
467
  client you will need.  You will need to make sure you have the appropriate accounts on these 
468
  systems.  You won't have to worry about SVN or CVS if you are installing from a Metacat
469
  source distribution.  These have all the required dependencies built in.</p>
470
  
471
  <p>If you have not already installed Subversion and you are running Ubuntu/Debian, you can 
472
  get it by typing:</p>
473
    <div class="code">sudo apt-get install subversion</div>
474
    
475
  <p>Otherwise, you can get if from <a href="http://subversion.tigris.org">The Subversion homepage</a></p>
476
  
477
  <p>If you have not already installed CVS and you are running Ubuntu/Debian, you can 
478
  get it by typing:</p>
479
    <div class="code">sudo apt-get install cvs</div>
480
    
481
  <p>Otherwise, you can get it from <a href="http://ximbiot.com/cvs/wiki/">The Ximbiot CVS homepage</a></p>
482
  
483
  <p>To check out the code from SVN, go to the directory where you would like the code 
484
    to live and type:</p>
485
      <div class="code">svn co https://code.ecoinformatics.org/code/metacat/tags/METACAT_&lt;rev&gt; metacat</div>
486
    <p>Where &lt;rev&gt; is the version of the code you want to check out (like 1_9). </p>
487
    
488
    <p>If you are trying to check out the head, type:</p>
489
      <div class="code">svn co https://code.ecoinformatics.org/code/metacat/trunk metacat</div>
490
      
491
    <p>You should see a list of files as they check out.</p>
492
    
493
    <p>Note that you do not need to create the war file directly with a source installation
494
    since the Ant build file has an "install" target that will build and deploy the war
495
    for you.  See the <a href="#InstallingMetacat">Installing Metacat</a> for instructions.</p>
496

    
497

    
498
<a name="InstallingMetacat"></a><div class="header1">Installing Metacat</div>
499
  <p>This section is only for a new installation. If you are upgrading an existing Metacat, please skip
500
  this section and go to the next one - <a href="#UpgradingMetacat">Upgrading Existing Metacat</a></p>
501
  
502
  <p>Tomcat will look for it's application files (war files) in a configured directory.  
503
  This is typically the &lt;tomcat_home&gt;/webapps directory, but your instance of Tomcat may 
504
  be configured to look in a different directory.  We will refer to your Tomcat application directory 
505
  as &lt;tomcat_app_dir&gt;.</p>
506
     
507
  <a name="CreateMetacatDirs"></a><div class="header2">Create Metacat Directories</div>
508
    <p>Metacat uses a base directory to store such things as store data and metadata,
509
    temporary files and configuration backups.  This directory should be outside of the 
510
    Tomcat application directory since the application directory gets wiped out during an
511
    upgrade. Create the metacat utility base directory 
512
    by typing:</p>
513
      <div class="code">sudo mkdir <metacat_base_dir></div>
514
    <p>(Typically <metacat_base_dir> is '/var/metacat'.)  Remember the directory you 
515
    choose, since you will be asked to configure Metacat to point to it after startup.</p>
516
    
517
    <p>Change the ownership of the directory by typing:</p>   
518
	  <div class="code">sudo chown -R &lt;tomcat_user&gt; /var/metacat</div>
519
    <p>where &lt;tomcat_user&gt; is the user that will start Tomcat.  If you are 
520
	starting Tomcat as the root user, you do not need to run the chown command.</p>
521
	
522
  <a name="InstallMetacatWar"></a><div class="header2">Install Metacat Binary (War)</div> 
523
    <p>Copy the war file to Tomcat:</p>
524
	  <div class="code">sudo cp knb.war &lt;tomcat_app_dir&gt;</div>
525
  
526
  <a name="InstallMetacatSource"></a><div class="header2">Install Metacat From Source</div> 
527
    <p>You will need Apache Ant to do the build.  If you have not already 
528
    installed Ant and you are running Ubuntu/Debian, you can get it by typing:</p>
529
      <div class="code">sudo apt-get install ant</div>
530
  
531
    <p>Otherwise, you can get ant from
532
    <a href="http://ant.apache.org/">The Apache Ant homepage</a></p>
533

    
534
    <p>You should now have the Metacat source in a directory named "metacat" in your
535
    code directory (We will refer to the metacat source directory as &lt;metacat_src_dir&gt;.
536
       
537
    <p>To prepare for the build, edit the file at:</p>
538
      <div class="code">&lt;metacat_src_dir&gt;/build.properties</div> 
539
    <p>Make sure that the "build.tomcat.dir" property is set to your tomcat installation
540
    directory.  For instance:</p>
541
      <div class="code">build.tomcat.dir=/usr/local/tomcat</div>
542
    <p>Metacat will use some of the native Tomcat libraries during the build.</p>
543
    
544
    <p>Make sure that the "app.deploy.dir" property is set to your application deployment
545
    directory.  For instance:</p>
546
      <div class="code">app.deploy.dir=/usr/local/tomcat/webapps</div>
547
    
548
    <p>If your cvs user is something other than the user your are logged in as, you
549
    will need to change the ${env.USER} part of the cvsroot property to be your cvs 
550
    user.  For instance:</p>
551
      <div class="code">cvsroot=:ext:cvs-user@cvs.ecoinformatics.org:/cvs</div>
552
    <p> where your cvs user name is "cvs-user"</p> 
553
    
554
    <p>In the &lt;metacat_src_dir&gt;, run: </p>
555
      <div class="code">ant clean install</div>
556
      
557
    <p>You will see the individual modules get built.  You will be prompted
558
    for your cvs password several times.  You should see a "BUILD SUCCESSFUL"
559
    message at the end.</p>
560
    
561
    <p>You should see a new file named knb.war in your application deployment directory.</div>
562
	  
563
  <a name="ApacheConfig"></a><div class="header2">Configure Apache</div> 
564
    <p>You have the option of running Tomcat stand-alone or with with the Apache web
565
    server.  Running with Apache is the more traditional setup since Apache is a 
566
    more robust web server.  There are some initial setup steps to get Apache talking
567
    to the Metacat application at the </p>
568
	  <a href="./metacat-apache-config.html"> the Metacat Apache Configuration page</a></p>
569

    
570
<a name="UpgradingMetacat"></a><div class="header1">Upgrading Existing Metacat</div>
571
  <a name="protocol"></a>
572
  <p>The following instructions are for upgrading an existing Metacat.
573
  
574
  <a name="UpgradeStopMetacat"></a><div class="header2">Stop the Running Metacat</div>
575
   <p>To do this, login as the user that runs your tomcat server (often "tomcat"),
576
   go to &lt;tomcat_home&gt;/bin and type:</p>
577
   
578
   <div class="code">./shutdown.sh</div>  
579
  
580
  <a name="UpgradeDownloadMetacat"></a><div class="header2">Download Latest Metacat Application</div>
581
    <p>Browse to the 
582
      <a href="http://knb.ecoinformatics.org/software/download.html">KNB Software Download Page</a>.
583
      In the Metacat section, select the link that looks like:</p>
584
	  <div class="code">metacat-bin-X.X.X.tar.gz</div>
585
    <p>where X.X.X is the latest version of Metacat.  Choose to save the file locally.</p>
586
    <p>Extract the Metacat package files by typing:</p>
587
      <div class="code">tar -xvzf metacat-bin-X.X.X.tar.gz</div>
588
    <p>You should see several files:</p>
589
    
590
    <ul>
591
    <li>knb.war - the Metacat application web archive file.</li>
592
    <li>knb - the web definition file used by Apache on ubuntu/debian Linux systems.</li>
593
    <li>jk.conf - the JkMount configuration file used by Apache on ubuntu/debian Linux systems.</li>
594
    <li>workers.properties - the workers definition file used by Apache on ubuntu/debian Linux systems.</li>
595
    <li>tomcat5.5 - the Tomcat startup script for Tomcat 5.5 installed with apt-get on ubuntu/debian Linux systems.</li>
596
    <li>authority - the optional LSID Server application web archive file.</li>
597
    </ul>
598
    
599
    <p>The location where these files
600
    were extracted will be refered to as the the &lt;metacat_package_dir&gt; for the remainder 
601
    of this documentation.</p>
602
 
603
   <a name="UpgradeMetacatWar"></a><div class="header2">Upgrade Metacat Binary (War)</div> 
604
    <p>Tomcat will look for it's application files (war files) in a configured directory.  
605
    This is typically the &lt;tomcat_home&gt;/webapps directory, but your instance of Tomcat may 
606
    be configured to look in a different directory.  We will refer to your Tomcat application directory 
607
    as &lt;tomcat_app_dir&gt;.</p>
608
    
609
    <p>If desired, back up your existing war file with a date:</p>
610
      <div class="code">sudo mv &lt;tomcat_app_dir&gt;/knb.war &lt;tomcat_app_dir&gt;/knb.war.&lt;yyyymmdd&gt;</div>
611
    
612
    <p>Copy the war file to the Tomcat applications directory:</p>
613
	  <div class="code">sudo cp knb.war &lt;tomcat_app_dir&gt;</div>
614
	<p>Remove (or rename) the existing application directory:</p>
615
	  <div class="code">sudo rm -rf &lt;tomcat_home&gt;/webapps/knb</div>
616
	  <p> or </p>
617
	  <div class="code">sudo mv &lt;tomcat_home&gt;/webapps/knb &lt;tomcat_home&gt;/webapps/knb.&lt;yyyymmdd&gt;</div>
618
	<p>Restart Tomcat:</p>  
619
	  <div class="code">sudo /etc/init.d/tomcat5.5 restart</div>
620
	<p>Tomcat will expand your war file into a new application directory at startup time.</p>
621
 
622
  <a name="UpgradeMetacatSource"></a><div class="header2">Upgrade Metacat From Source</div>
623
    <p>The steps to upgrade Metacat from source are the same as installing from source.  See
624
    the <a href="#InstallMetacatSource">Install Metacat From Source</a> section above.</p>
625
 
626
  <a name="RestartTomcat"></a><div class="header1">Restart Tomcat</div>
627
    <p>Once you have successfully installed Metacat, there is one more step.  Tomcat
628
    (and Apache if you have Tomcat integrated with it) must be restarted.  To do
629
    this, login as the user that runs your tomcat server (often "tomcat"),
630
    go to &lt;tomcat_home&gt;/bin and type: </p>
631
   
632
      <div class="code">./startup.sh</div>
633
   
634
    <p>In the Tomcat startup messages you should see something in the log file like:</p>
635
   
636
      <div class="code">Metacat: [WARN]: Metacat (1.8.0) initialized. [edu.ucsb.nceas.metacat.MetaCatServlet]</div>
637
     
638
    If you see that message Tomcat has successfully loaded the Metacat servlet.
639
    Next, try to run your new servlet.  Go to a web browser and type:</p>
640
   
641
      <div class="code">http://yourserver.yourdomain.com/yourcontext/</div>
642
     
643
    <p>You should substitute your context name for "yourcontext" in the url above.
644
    If everything is working correctly, you should see a query page followed
645
    by an empty result set.  Note that if you do not have Tomcat integrated with
646
    Apache you will probably have to type</p>
647
   
648
    <div class="code">http://yourserver.yourdomain.com:8080/yourcontext/</div>
649

    
650
  <a name="UpgradeTroubleshooting"></a><div class="header2">Troubleshooting</div>
651
  <p>If you see something like: 
652
  
653
    <div class="code">java.lang.InternalError: Can't connect to X11 window server using 'yourservanme:0.0' as the value of the DISPLAY variable.</div>
654
  
655
  <p>You should add this line: </p>
656
  
657
    <div class="code">JAVA_OPTS="-Djava.awt.headless=true $JAVA_OPTS"</div> 
658
    
659
  <p>at the first line of the catalina.sh file in the tomcat bin directory. The reason is that 
660
  GeoServer uses X11 windows to draw graphics.</p>
661
  
662
  <a name="UpgradeConfigureMetacat"></a><div class="header2">Configure Metacat</div>
663
  <p>Once you see the Metacat configuration screen, you can follow the instructions in the 
664
  <a href="./metacat-configure.html"> Configuring Metacat Section</a> 
665
  to complete the internal configuration of Metacat.</p>
666

    
667
<a name="Registry"></a><div class="header1">Web Based Registry</div>
668
  <p>The registry allows users to upload simple metadata documents directly from the web.  See the separate 
669
  <a href="registry_installation.html">Registry Installation Guide</a>.</p><br/><br/>
670
</body>
671
</html>
(24-24/63)