Project

General

Profile

1 6147 jones
Downloading and Installing Metacat
2
==================================
3
4 6838 jones
Instructions for both Linux and Windows systems are included in this section.
5 6147 jones
6 6838 jones
.. contents::
7
8 6147 jones
System Requirements
9
-------------------
10 6838 jones
In addition to meeting the recommended system requirements, the server on which
11
you wish to install Metacat must have the following software installed and
12
running correctly:
13 6147 jones
14 6838 jones
* PostgreSQL_ (or another SQL92-compliant RDBMS like Oracle_)
15
* `Apache Ant`_ (if building from source)
16
* `Apache Tomcat`_
17
* `Apache HTTPD Server`_ (recommended)
18
19
  * In order to use the Metacat Registry (and for a more robust Web-serving environment in general), the Apache Web server should be installed with Tomcat and the two should be integrated. See the installing Apache for more information.
20
21 6870 jones
* `Java 6`_ (Note: Java 5 is deprecated)
22 6838 jones
23
.. _PostgreSQL: http://www.postgresql.org/
24
25
.. _Oracle: http://www.oracle.com/
26
27
.. _Apache Ant: http://ant.apache.org/
28
29
.. _Apache Tomcat: http://tomcat.apache.org/
30
31
.. _Apache HTTPD Server: http://httpd.apache.org/
32
33 6870 jones
.. _Java 6: http://www.oracle.com/technetwork/java/javaee/overview/index.html
34 6838 jones
35
System requirements for running Metacat:
36
37
.. NOTE::
38
39
   Check these system requirements
40
41
* a server running an SQL92-compliant database (PostgreSQL_ recommended)
42
* at least 128MB RAM
43
* a Pentium III processor (or higher)
44
* 11 MB disk space (Note: The amount of disk space required depends on the size of your RDBMS tablespace (which should be at least 10 MB; however, Metacat itself requires only about 140 MB of free space after installation).
45
46
47 6147 jones
Installing on Linux
48
-------------------
49 6838 jones
This section contains instructions for downloading and installing Metacat on
50
Linux systems. As Mac OS X is based on BSD Unix, these Linux instructions can
51
be adapted to also work on Mac OS X (although the exact commands for
52
downloading and installing packages will differ due to the different package
53
management approaches on the Mac).
54 6147 jones
55
Quick Start Overview
56
~~~~~~~~~~~~~~~~~~~~
57 6838 jones
For the impatient or those who have already installed Metacat and know what
58
they are doing, here are the steps needed to install Metacat. Detailed
59
instructions for each step are in the next section.
60 6147 jones
61 6870 jones
1. Download and install prerequisites (`Java 6`_, `Apache Tomcat`_ 6, PostgreSQL_, `Apache HTTPD Server`_)
62 6838 jones
2. Create a database in PostgreSQL named 'metacat' and authorize access to it in ``pb_hba.conf`` for the user 'metacat'
63
3. Log in to PostgreSQL and create the 'metacat' user
64
4. Download Metacat from the `Metacat Download Page`_ and extract the archive
65
5. ``sudo mkdir /var/metacat; sudo chown -R <tomcat_user> /var/metacat``
66
6. ``sudo cp <metacat_package_dir>/knb.war <tomcat_app_dir>``
67 6870 jones
7. ``sudo /etc/init.d/tomcat6 restart``
68 6838 jones
8. Configure Metacat through the Web interface
69
70
.. _Metacat Download Page: http://knb.ecoinformatics.org/software/metacat/
71
72 6147 jones
Downloading Metacat
73
~~~~~~~~~~~~~~~~~~~
74 6838 jones
Before installing Metacat, please ensure that all required software is
75
installed and running correctly. To obtain a Metacat WAR file, which is needed
76
for installation, download one of the following:
77 6147 jones
78 6838 jones
* the Metacat installer, which has a pre-built WAR file,
79
* the Metacat source distribution, which must be built in order to create a WAR file,
80
* the Metacat source code from SVN. You must build the source code in order to create a WAR file.
81
82
Instructions for all three options are discussed below. Note that downloading
83
the installer (described in the next section) is the simplest way to get
84
started.
85
86 6147 jones
Download the Metacat Installer
87
..............................
88 6838 jones
Downloading the Metacat Installer is the simplest way to get started with the
89
application. To download the installer:
90 6147 jones
91 6838 jones
1.  Browse to the `Metacat Download Page`_. In the Metacat section, select the link to the "GZIP file" (the link should look like: metacat-bin-X.X.X.tar.gz, where X.X.X is the latest version of Metacat e.g., 1.9.0)
92
2.  Save the file locally.
93
3.  Extract the Metacat package files by typing:
94
95
::
96
97
  tar -xvzf metacat-bin-X.X.X.tar.gz
98
99
You should see a WAR file and several supporting files (Table 2.1). The
100
extraction location will be referred to as the ``<metacat_package_dir>`` for the
101
remainder of this documentation.
102
103
================== ===========================================================
104
File               Description
105
================== ===========================================================
106
knb.war            The Metacat Web archive file (WAR)
107
knb                The Web definition file used by Apache on Ubuntu/Debian
108
                   Linux systems.
109 6870 jones
knb.ssl            The SSL definition file used by Apache on Ubuntu/Debian
110 6838 jones
                   Linux systems.
111
jk.conf            The JkMount configuration file used by Apache on
112
                   Ubuntu/Debian Linux systems.
113
workers.properties The workers definition file used by Apache on Ubuntu/Debian
114
                   Linux systems.
115
authority          The optional LSID Server application WAR
116
================== ===========================================================
117
118
119 6147 jones
Download Metacat Source Code
120
............................
121 6838 jones
To get the Metacat source distribution:
122 6147 jones
123 6838 jones
1. Browse to the `Metacat Download Page`_. In the Metacat section, select the link to the Metacat Source code (it will look something like this: metacat-src-X.X.X.tar.gz, where X.X.X is the latest version of Metacat, e.g., 1.9.0).
124
2. Save the file locally.
125
3. Extract the Metacat package files by typing (replace X.X.X with the current version number):
126
127
::
128
129
  tar -xvzf metacat-src-X.X.X.tar.gz
130
131
4. Rename the metacat-X.X.X directory to metacat.
132
133
Note that you do not need to create the WAR file directly because the Ant
134
build-file has an "install" target that will build and deploy the WAR for you.
135
136
137 6147 jones
Check Out Metacat Source Code from SVN (for Developers)
138
.......................................................
139 6838 jones
If you wish to work with the most recent Metacat code, or you'd like to extend
140
the Metacat code yourself, you may wish to check out the Metacat source code
141
from SVN. You will need a Subversion (SVN) client installed and configured on
142
your system (see the end of this section for information about obtaining an SVN
143
client).
144 6147 jones
145 6838 jones
.. sidebar:: Installing an SVN Client:
146
147
    If you have not already installed Subversion and you are running Ubuntu/Debian,
148
    you can get the SVN client by typing:
149
150
    ::
151
152
        sudo apt-get install subversion
153
154
    Otherwise, you can get the SVN client from The Subversion homepage
155
    (http://subversion.tigris.org/).
156
157
To check out the code from SVN, go to the directory where you would like the
158
code to live and type::
159
160
  svn co https://code.ecoinformatics.org/code/metacat/tags/METACAT_<rev> metacat
161
162
Where ``<rev>`` is the version of the code you want to check out (like 1_9).
163
164
To check out the head, type::
165
166
  svn co https://code.ecoinformatics.org/code/metacat/trunk metacat
167
168
You should see a list of files as they check out.
169
170
Note that you do not need to create the WAR file directly because the Ant
171
build-file has an "install" target that will build and deploy the WAR for you.
172
173
174 6147 jones
Installing and Configuring Required Software
175
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176 6838 jones
Before you can install and run Metacat, you must ensure that a recent Java SDK,
177
PostgreSQL (or another SQL92-compliant RDBMS like Oracle 8i), Ant (if
178
installing from source), and Tomcat are installed and running correctly. We
179
also highly recommend that you install Apache Web server, as it provides a more
180
robust Web-serving environment and is required by some Metacat functionality.
181 6147 jones
182 6870 jones
* `Java 6`_
183 6838 jones
* `Apache Tomcat`_
184
* `Apache HTTPD Server`_ (Highly Recommended)
185
* PostgreSQL_ Database (or Oracle_)
186
* `Apache Ant`_ (if building from Source)
187
188 6147 jones
Java 6
189
......
190 6838 jones
To run Metacat, you should use Java 6 (Java 5 is deprecated and will not be
191
supported after Metacat version 1.9.2). Make sure that the JAVA_HOME
192
environment variable is properly set and that both ``java`` and ``javac``
193
are on your PATH.
194 6147 jones
195 6838 jones
To install Java if you are running Ubuntu_/Debian, type::
196 6147 jones
197 6838 jones
  sudo apt-get install sun-java6-jdk
198 6147 jones
199 6838 jones
Click "ok" then "yes" for license agreement.
200 6147 jones
201 6838 jones
If you are not using Ubuntu_/Debian, you can get Java from the Oracle_ website.
202
203
.. _Ubuntu: http://www.ubuntu.com/
204
205
Apache Tomcat
206
.............
207
We recommend that you install Tomcat 6 into the directory of your choice.
208
Included with the Metacat download is a Tomcat-friendly start-up script that
209
should be installed as well.
210
211
Note: we will refer to the Tomcat installation directory as ``<tomcat_home>`` for
212
the remainder of the documentation.
213
214
If you are running Ubuntu_/Debian, get Tomcat by typing::
215
216 6870 jones
  sudo apt-get install tomcat6
217 6838 jones
218
Otherwise, get Tomcat from the `Apache Tomcat`_ page.
219
220
Apache HTTPD Server (Highly Recommended)
221
........................................
222
Although you have the option of running Metacat with only the Tomcat server, we
223
highly recommend that you run it behind the Apache Web server for several
224
reasons; running Tomcat with the Apache server provides a more robust Web
225
serving environment, and the Apache Web server is required if you wish to
226
install and run the Metacat Registry.
227
228
.. sidebar:: Configuring Apache on an OS other than Ubuntu/Debian
229
230
  If you are running on an O/S other than Ubuntu/Debian (e.g., Fedora Core or
231
  RedHat Linux) or if you installed the Apache source or binary, you must
232
  manually edit the Apache configuration file, where <apache_install_dir> is the
233
  directory in which Apache is installed:
234
235
  ::
236
237
    <apache_install_dir>/conf/httpd.conf
238
239
  1. Configure the log location and level for Mod JK. If your configuration file does not already have the following section, add it and set the log location to any place you'd like:
240
241
    ::
242
243
      <IfModule mod_jk.c>
244
        JkLogFile "/var/log/tomcat/mod_jk.log"
245
        JkLogLevel info
246
      </IfModule>
247
248
  2. Configure apache to route traffic to the Metacat application. ServerName should be set to the DNS name of the Metacat server. ScriptAlias and the following Directory section should both point to the cgi-bin directory inside your Metacat installation:
249
250
    ::
251
252
      <VirtualHost XXX.XXX.XXX.XXX:80>
253
        DocumentRoot /var/www
254
        ServerName dev.nceas.ucsb.edu
255
        ErrorLog /var/log/httpd/error_log
256
        CustomLog /var/log/httpd/access_log common
257
        ScriptAlias /cgi-bin/ "/var/www/cgi-knb/"
258
        <Directory /var/www/cgi-knb/>
259
          AllowOverride None
260
          Options ExecCGI
261
          Order allow,deny
262
          Allow from all
263
        </Directory>
264
        ScriptAlias /knb/cgi-bin/ "/var/www/webapps/knb/cgi-bin/"
265
        <Directory "/var/www/webapps/knb/cgi-bin/">
266
          AllowOverride None
267
          Options ExecCGI
268
          Order allow,deny
269
          Allow from all
270
        </Directory>
271
        JkMount /knb ajp13
272
        JkMount /knb/* ajp13
273
        JkMount /knb/metacat ajp13
274
        JkUnMount /knb/cgi-bin/* ajp13
275
        JkMount /*.jsp ajp13
276
        JkMount /metacat ajp13
277
        JkMount /metacat/* ajp13
278
      </VirtualHost>
279
280
  3. Copy the "workers.properties" file provided by Metacat into your Apache configuration directory (<apache_install_dir>/conf/).  Depending on whether you are installing from binary distribution or source, the workers.properties file will be in one of two locations:
281
282
    * the directory in which you extracted the Metacat distribution (for binary distribution)
283
    * <metacat_code_dir>/src/scripts/workers.properties (for both the source distribution and source code checked out from SVN)
284
285
  4. Edit the workers.properties file and make sure the following properties are set correctly:
286
287
    ::
288
289
      workers.tomcat_home -  set to the Tomcat install directory.
290
      workers.java_home - set to the Java install directory.
291
292
  5. Restart Apache to bring in changes by typing:
293
294
    ::
295
296
      sudo /etc/init.d/apache2 restart
297
298
This section contains instructions for installing and configuring the Apache
299
Web server for Metacat on an Ubuntu_/Debian system. Instructions for configuring
300
Apache running on other Linux systems are included in the sidebar.
301
302
1. Install the Apache and Mod JK packages (Mod JK is the module Apache uses to talk to Tomcat applications) by typing:
303
304
::
305
306
  sudo apt-get install apache2 libapache2-mod-jk
307
308
If you are installing the Apache server on an Ubuntu/Debian system, and you
309
installed Apache using apt-get as described above, the Metacat code will have
310
helper files that can be dropped into directories to configure Apache.
311
Depending on whether you are installing from binary distribution or source,
312
these helper files will be in one of two locations:
313
314
* the directory in which you extracted the distribution (for binary distribution)
315
* ``<metacat_code_dir>/src/scripts`` (for both the source distribution and source code checked out from SVN).  We will refer to the directory with the helper scripts as ``<metacat_helper_dir>`` and the directory where Apache is installed (e.g., ``/etc/apache2/``) as ``<apache_install_dir>``.
316
317
2. Set up Mod JK apache configuration by typing:
318
319
::
320
321
  sudo cp <metacat_helper_dir>/jk.conf <apache_install_dir>/mods-available
322
  sudo cp <metacat_helper_dir>/workers.properties <apache_install_dir>
323
324
3. Disable and re-enable the Apache Mod JK module to pick up the new changes:
325
326
::
327
328
  sudo a2dismod jk
329
  sudo a2enmod jk
330
331
4. Apache needs to know about the Metacat site. The helper file named "knb" has rules that tell Apache which traffic to route to Metacat. Set up the knb (Metacat) site by dropping the knb file into the sites-available directory and running a2ensite to enable the site:
332
333
::
334
335
  sudo cp <metacat_helper_dir>/knb <apache_install_dir>/sites-available
336
  sudo a2ensite knb
337
338
5. Restart Apache to bring in changes by typing:
339
340
::
341
342
  sudo /etc/init.d/apache2 restart
343
344
345 6870 jones
PostgreSQL Database
346 6838 jones
...................
347
Metacat has been most widely tested with PostgreSQL_ and we recommend using it.
348
Instructions for installing and configuring Oracle are also included in the
349
next section.  To install and configure PostgreSQL_:
350
351
1. If you are running Ubuntu_/Debian, get PostgreSQL by typing:
352
353
  ::
354
355
    sudo apt-get install postgresql
356
357
  On other systems, install the rpms for postgres.
358
359
2. Start the database by running:
360
361
  ::
362
363
    /etc/init.d/postgresql start
364
365
3. Change to postgres user:
366
367
  ::
368
369
    sudo su - postgres
370
371
372
4. Set up an empty Metacat database instance by editing the postgreSQL configuration file:
373
374
  ::
375
376
    gedit /etc/postgresql/8.3/main/pg_hba.conf
377
378
379
  Add the following line to the configuration file:
380
381
  ::
382
383
    host metacat metacat 127.0.0.1 255.255.255.255 password
384
385
386
  Save the file and then create the Metacat instance:
387
388
  ::
389
390
    createdb metacat
391
392
393
5. Log in to postgreSQL by typing:
394
395
  ::
396
397
    psql metacat
398
399
400
6. At the psql prompt, create the Metacat user by typing:
401
402
  ::
403
404
    CREATE USER metacat WITH UNENCRYPTED PASSWORD 'your_password';
405
406
  where 'your_password' is whatever password you would like for the Metacat user.
407
408
7. Exit PostgreSQL by typing
409
410
  ::
411
412
    \q
413
414
8. Restart the PostgreSQL database to bring in changes:
415
416
  ::
417
418
    /etc/init.d/postgresql-8.3 restart
419
420
9. Log out of the postgres user account by typing:
421
422
  ::
423
424
    logout
425
426
10. Test the installation and Metacat account by typing:
427
428
  ::
429
430
    psql -U metacat -W -h localhost metacat
431
432
11. Log out of postgreSQL:
433
434
  ::
435
436
    \q
437
438
439
The Metacat servlet automatically creates the required database schema. For
440
more information about configuring the database, please see Database
441
Configuration.
442
443 6147 jones
Installing and Configuring Oracle 8i
444
....................................
445 6838 jones
To use Oracle 8i with Metacat, the Oracle RDBMS must be installed and running
446
as a daemon on the system. In addition the JDBC listener must be enabled.
447
Enable it by logging in as an Oracle user and typing::
448 6147 jones
449 6838 jones
  lsnrctl start
450 6147 jones
451 6838 jones
Your instance should have a table space of at least 5 MB (10 MB or higher
452
recommended). You must also create and enable a username specific to Metacat.
453
The Metacat user must have most normal permissions including: CREATE SESSION,
454
CREATE TABLE, CREATE INDEX, CREATE TRIGGER, EXECUTE PROCEDURE, EXECUTE TYPE,
455
etc. If an action is unexplainably rejected by Metacat, the user permissions
456
are (most likely) not correctly set.
457
458
The Metacat servlet automatically creates the required database schema. For
459
more information, please see Database Configuration.
460
461
Apache Ant (if building from Source)
462
....................................
463
If you are building Metacat from a source distribution or from source code
464
checked out from SVN, Ant is required. (Users installing Metacat from the
465
binary distribution do not require it.) Ant is a Java-based build application
466
similar to Make on UNIX systems. It takes build instructions from a file named
467
"build.xml", which is found in the root installation directory. Metacat source
468
code comes with a default "build.xml" file that may require some modification
469
upon installation.
470
471
If you are running Ubuntu/Debian, get Ant by typing::
472
473
  sudo apt-get install ant
474
475
Otherwise, get Ant from the `Apache Ant`_ homepage.
476
477
Ant should be installed on your system and the "ant" executable shell script
478
should be available in the user's path. The latest Metacat release was tested
479 6870 jones
with Ant 1.8.2.
480 6838 jones
481 6147 jones
Installing Metacat
482
~~~~~~~~~~~~~~~~~~
483 6838 jones
Instructions for a new install, an upgrade, and a source install are included
484
below.
485 6147 jones
486 6838 jones
New Install
487
...........
488
Before installing Metacat, please ensure that all required applications are
489
installed, configured to run with Metacat, and running correctly. If you are
490
upgrading an existing Metacat servlet, please skip to Upgrade. For information
491
about installing from source, skip to Source Install and Upgrade.
492
493
To install a new Metacat servlet:
494
495
1. Create the Metacat directory. Metacat uses a base directory to store data, metadata, temporary files, and configuration backups. This directory should be outside of the Tomcat application directory so that it will not get wiped out during an upgrade. Typically, the directory is '/var/metacat', as shown in the instructions. If you choose a different location, remember it. You will be asked to configure Metacat to point to the base directory at startup.  Create the Metacat directory by typing:
496
497
  ::
498
499
    sudo mkdir /var/metacat
500
501
2. Change the ownership of the directory to the user that will start Tomcat by typing (note: If you are starting Tomcat as the root user, you do not need to run the chown command):
502
503
  ::
504
505
    sudo chown -R <tomcat_user> /var/metacat
506
507
508 6870 jones
3.  Install the Metacat WAR in the Tomcat web-application directory. For instructions on downloading the Metacat WAR, please see Downloading Metacat.  Typically, Tomcat will look for its application files (WAR files) in the <tomcat_home>/webapps directory (e.g., /usr/share/tomcat6/webapps). Your instance of Tomcat may be configured to look in a different directory. We will refer to the Tomcat application directory as <tomcat_app_dir>.  NOTE: The name of the WAR file (e.g., knb.war) provides the application context, which appears in the URL of the Metacat (e.g., http://yourserver.com/knb/). To change the context, simply change the name of the WAR file to the desired name before copying it.  To install the Metacat WAR:
509 6838 jones
510
  ::
511
512
    sudo cp <metacat_package_dir>/knb.war <tomcat_app_dir>
513
514
515
4. Restart Tomcat. Log in as the user that runs your Tomcat server (often "tomcat") and type:
516
517
  ::
518
519 6870 jones
    /etc/init.d/tomcat6 restart
520 6838 jones
521
Congratulations! You have now installed Metacat. If everything is installed
522
correctly, you should see the Authentication Configuration screen (Figure 2.1)
523
when you type http://yourserver.com/yourcontext/ (e.g.,
524
http://knb.ecoinformatics.org/knb) into a browser. For more information about
525
configuring Metacat, please see the Configuration Section.
526
527 6870 jones
.. figure:: images/screenshots/image009.png
528 6838 jones
   :align: center
529
530
   The Authentication Configuration screen appears the first time you open a
531
   new installation of Metacat.
532
533
Upgrade Metacat
534
...............
535
To upgrade an existing binary Metacat installation follow the steps in this
536
section. The steps for upgrading Metacat from source are the same as the
537
instructions for installing from source:
538
539
1. Download and extract the new version of Metacat. For more information about downloading and extracting Metacat, please see Downloading Metacat.
540
541
2. Stop running Metacat. To stop Metacat, log in as the user that runs your Tomcat server (often "tomcat") and type:
542
543
  ::
544
545 6870 jones
    /etc/init.d/tomcat6 stop
546 6838 jones
547
3. Back up the existing Metacat installation. Although not required, we highly recommend that you back up your existing Metacat to a backup directory (<backup_dir>) before installing a new one. You can do so by typing:
548
549
  ::
550
551
    cp <web_app_dir>/knb <backup_dir>/knb.<yyyymmdd>
552
    cp <web_app_dir>/knb.war <backup_dir>/knb.war.<yyyymmdd>
553
554
  Warning: Do not backup the files to the ``<web_app_dir>`` directory.  Tomcat will
555
  try to run the backup copy as a service.
556
557
4. Copy the new Metacat WAR file in to the Tomcat applications directory:
558
559
  ::
560
561
    sudo cp <metacat_package_dir>/knb.war <tomcat_app_dir>
562
563
  Note: Typically, Tomcat will look for its application files (WAR files) in the
564
  ``<tomcat_home>/webapps`` directory. Your instance of Tomcat may be configured to
565
  look in a different directory.
566
567
5. If you have been (or would like to start) running an LSID server, copy the new authority.war file to the Tomcat applications directory. For more information about the LSID server, please see Optional Installation Options.
568
569
  ::
570
571
    sudo cp <metacat_package_dir>/authority.war <tomcat_app_dir>
572
573
6. Restart Tomcat (and Apache if you have Tomcat integrated with it). Log in as the user that runs your Tomcat server (often "tomcat"), and type:
574
575
  ::
576
577 6870 jones
    /etc/init.d/tomcat6 restart
578 6838 jones
579
580
7. Run your new Metacat servlet. Go to a Web browser and visit your installed
581
Metacat application, using a URL of the form:
582
583
  ::
584
585
    http://yourserver.yourdomain.com/yourcontext/
586
587
You should substitute your context name for "yourcontext" in the URL above
588
(your context will be "knb" unless you change the name of the knb.war file to
589
something else). If everything is working correctly, you should be presented
590
with Metacat's Authorization Configuration screen. Note that if you do not have
591
Tomcat integrated with Apache you will probably have to type
592
http://yourserver.yourdomain.com:8080/yourcontext/
593
594
Source Install and Upgrade
595
..........................
596
Whether you are building Metacat from the source distribution or source code
597
checked out from SVN, you will need Apache Ant to do the build (see Installing
598
and Configuring Required Software for more information about Ant).
599
600
To install Metacat from source:
601
602
1. Edit the build.properties file found in the directory in which you
603
   downloaded Metacat. Note: Throughout the instructions, we will refer to this
604
   directory as ``<metacat_src_dir>``.
605
606
  * Set the build.tomcat.dir property to your Tomcat installation directory.
607
    Metacat will use some of the native Tomcat libraries during the build. For
608
    instance: build.tomcat.dir=/usr/local/tomcat
609
  * Set the app.deploy.dir property to your application deployment directory.
610
    For instance: app.deploy.dir=/usr/local/tomcat/webapps
611
612
2. In the ``<metacat_src_dir>``, run:
613
614
  ::
615
616
    sudo ant clean install
617
618
  You will see the individual modules get built. You should see a "BUILD
619
  SUCCESSFUL" message at the end.
620
621
  You should see a new file named knb.war in your application deployment
622
  directory.
623
624
To run your new Metacat servlet, open a Web browser and type::
625
626
  http://yourserver.yourdomain.com/yourcontext/
627
  (e.g.  http://knb.ecoinformatics.org/knb/)
628
629
Your context will be "knb" unless you changed the name of the knb.war file to
630
something else. The servlet may require a few seconds to start up, but once it
631
is running, you will be presented with the Authorization Configuration screen.
632
633 6147 jones
Optional Installation Options (LSID Server)
634
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
635
636 6838 jones
.. Note::
637
638
  The support for LSID identifiers is deprecated, and is being replaced with
639
  support for DOI_ identifiers in a future release. We are maintaining support
640
  for LSIDs on one particular site, but this support will be removed in a
641
  future version of Metacat.
642
643
.. _DOI: http://www.doi.org/
644
645
Metacat's optional LSID server allows Metacat to use a standardized syntax for
646
identifying data sets, in addition to Metacat's internal, custom scheme for
647
identifiers. LSID's were designed to identify complex biological entities with
648
short identifiers (much like DOIs in publishing) that are both computer and
649
human readable. LSID identifiers are URIs and are therefore usable in many
650
Internet applications, but they also cleanly separate the identity of a data
651
set (i.e., its permenant identifier) from its current location (e.g., the list
652
of URLs from which it might be retrieved).  LSIDs accomplish this by using a
653
level of indirection; the identifier represents simply a name without location,
654
but an associated resolver service can be used to locate the current location
655
of the data and medata for the data set.  This is accomplished by establishing
656
a well-known location for the resolution service for each authority using an
657
infrequently used feature of the domain name system called SRV records.  At its
658
most basic, resolution of an identifier is performed when a client looks up the
659
SRV record for an LSID by querying DNS, which returns the current host and port
660
of the authority web service, which is in turn used to locate the data and
661
metadata.
662
663
Using LSIDs to identify data records is being debated among members of the
664
Taxonomic Databases Working Group (TDWG).  There are several alternate
665
technologies that are under consideration (e.g., DOI_, plain http URIs), and so
666
at this time the support for LSIDs in Metacat has been created on an
667
experimental basis only.  If the LSID approach is ratified by the broader
668
community, we will expand support for LSIDs in Metacat, but until then it is an
669
optional and experimental feature.
670
671
The format of an LSID is::
672
673
  urn:lsid:<Authority>:<Namespace>:<ObjectID>[:<Version>]
674
  e.g., urn:lsid:ecoinformatics.org:tao:12039:1
675
676
When you enable the Metacat LSID support, you can use LSID clients (such as
677
LSID Launchpad) and LSID notation to query Metacat for data and metadata. LSID
678
notation can be used directly in Metacat HTTP queries as well. For example, a
679
data package with an ID tao.12039.1 that is stored in a Metacat available at:
680
http://example.com:9999 can be accessed by the following HTTP Metacat queries::
681
682
  http://example.com:9999/authority/data?lsid=urn:lsid:ecoinformatics.org:tao:12039:1
683
  (To return the data)
684
685
  http://example.com:9999/authority/metadata?lsid=urn:lsid:ecoinformatics.org:tao:12039:1
686
  (To return the metadata)
687
688
Notice that in the HTTP query strings, the periods in the data package ID have
689
been replaced with colons. The authority (ecoinformatics.org) must be properly
690
configured by the Metacat administrator. Note: In order to configure the
691
authority, you must have access to the DNS server for the Metacat domain.
692
Further instructions are provided below.
693
694
Install and configure the LSID Server shipped with Metacat
695
..........................................................
696
697
To install the LSID server using the binary installation:
698
699
1. Copy the authority.war file to Tomcat:
700
701
  ::
702
703 6870 jones
    sudo cp <metacat_package_directory>/authority.war /usr/share/tomcat6/webapps
704 6838 jones
705
2. Set up the LSID server by dropping the authority file into Apache's
706
   sites-available directory and running a2ensite to enable the site:
707
708
   ::
709
710
     sudo cp <metacat_helper_dir>/authority /etc/apache2/sites-available
711
     sudo a2ensite authority
712
713
3. Restart Tomcat. Log in as the user that runs your Tomcat server (often
714
   "tomcat") and type:
715
716
   ::
717
718
     /etc/init.d/tomcat5.5 restart
719
720
4. Restart Apache to bring in changes by typing:
721
722
  ::
723
724
    sudo /etc/init.d/apache2 restart
725
726
5. See notes beneath LSID server source installation for instructions for
727
   modifying the SRV record(s)
728
729
To install the LSID server from a source
730
........................................
731
732
1. In the build.properties file found in the directory into which you
733
   extracted the Metacat source code, set the authority and config.lsidauthority
734
   properties. For example:
735
736
  ::
737
738
   authority.context=authority
739
   config.lsidauthority=ecoinformatics.org
740
741
2. In the <metacat-src-dirctory> create the authority.war by running:
742
743
  ::
744
745
    sudo ant war-lsid
746
747
3. Copy the LSID WAR file into the Tomcat application directory.
748
749
  ::
750
751
    sudo cp <metacat_package_dir>/dist/authority.war <tomcat_app_dir>
752
753
4. Restart Tomcat. Log in as the user that runs your Tomcat server (often
754
   "tomcat") and type:
755
756
  ::
757
758 6870 jones
    /etc/init.d/tomcat6 restart
759 6838 jones
760
5. If you are running Tomcat behind the Apache server (the recommended
761
   configuration), set up and enable the authority service site configurations by
762
   typing:
763
764
  ::
765
766
    sudo cp <metacat_helper_dir>/authority <apache_install_dir>/sites-available
767
    sudo a2ensite authority
768
769
  Where <metacat_helper_dir> can be found in <metacat_code_dir>/src/scripts
770
771
6.  Restart Apache to bring in changes by typing:
772
773
  ::
774
775
    sudo /etc/init.d/apache2 restart
776
777
  Once the authority.war is installed, you must also modify the SRV record(s)
778
  on the DNS server for the domain hosting the Metacat. The record should be
779
  added to the master zone file for the metacat's DNS server:
780
781
    ::
782
783
      _lsid._tcp      IN      SRV     1       0       8080    <metacat.edu>.
784
785
  Where <metacat.edu> is the name of the machine that will serve as the
786
  physical location of the AuthorityService.
787
788
  For example, the value of <metacat.edu> for the below example URL would be
789
  example.com:
790
791
    ::
792
793
      http://example.com:9999/authority/data?lsid=urn:lsid:ecoinformatics.org:tao:12039:1
794
795
  For more information, please see http://www.ibm.com/developerworks/opensource/library/os-lsid/
796
797 6147 jones
Troubleshooting
798
~~~~~~~~~~~~~~~
799 6838 jones
We keep and update a list of common problems and their solutions on the KNB
800
website. See http://knb.ecoinformatics.org/software/metacat/troubleshooting.html
801
for more information.
802 6147 jones
803
Installing on Windows
804
---------------------
805 6838 jones
Metacat can be installed on Windows. Please follow the instructions in this
806
section for downloading Metacat, installing the required software, and
807
installing Metacat. Note that Registry and Data Upload functionality has not
808
been tested on Windows.
809
810
Download Metacat
811
~~~~~~~~~~~~~~~~
812
To obtain a Metacat WAR file, which is used when installing the Metacat
813
servlet:
814
815
1. Browse to the KNB Software Download Page. In the Metacat section, select
816
   the link that looks like: metacat-bin-X.X.X.zip, where X.X.X is the latest
817 6870 jones
   version of Metacat (e.g., 2.0.0).
818 6838 jones
819
2. Choose to download and Save the file locally.
820
821
3. Extract the Metacat package files using your Windows zip utility. You
822
   should see a WAR file and several supporting files (we will only use the WAR
823
   file when installing Metacat).
824
825
Note: The location where these files were extracted will be referred to as the
826
``<metacat_package_dir>`` for the remainder of this documentation.
827
828
Note: Before installing Metacat, please ensure that all required software is
829
installed and running correctly.
830
831
832
Install Required Software
833
~~~~~~~~~~~~~~~~~~~~~~~~~
834
Before you can install and run Metacat, you must ensure that a recent Java SDK,
835
PostgreSQL and Tomcat are installed, configured, and running correctly.
836
837 6870 jones
* `Java 6`_
838 6838 jones
* `Apache Tomcat`_
839
* PostgreSQL_ Database
840
841
Java 6
842
......
843
To run Metacat, you must have Java 6. (Java 5 is deprecated). Make sure that
844
the JAVA_HOME environment variable is properly set and that both java and javac
845
are on your PATH.
846
847
To download and install Java:
848
849
1. Browse to: http://java.sun.com/javase/downloads/widget/jdk6.jsp and follow
850
   the instructions to download JDK 6.
851
852
2. Run the downloaded installer to install Java.
853
854
3. Set the JAVA_HOME environment variable: In "My Computer" properties, go to
855
   "advanced settings > environment variables". Add:
856
857
  ::
858
859
    System Variable: JAVA_HOME C:\Program Files\Java\jdk1.6.0_18
860
    (or whichever version you downloaded)
861
862
Apache Tomcat
863
.............
864
We recommend that you install Tomcat version 6.  To download and install Tomcat:
865
866 6870 jones
1. Browse to: http://tomcat.apache.org/
867 6838 jones
2. Download the Tomcat core zip file
868
3. Extract Tomcat files to C:\Program Files\tomcat using the windows zip
869
   utility.
870
871
PostgreSQL Database
872
...................
873
Metacat can be run with several SQL92-compliant database systems, but it has
874
been most widely tested with PostgreSQL_. Instructions for installing and
875
configuring PostgreSQL for use with Metacat are included in this section.
876
877
To download and install PostgreSQL:
878
879
1. Browse to http://www.postgresql.org/download/windows and download the
880
   one-click installer
881
2. Run the installer
882
3. Edit C:\Program Files\PostgreSQL\8.3\data and add:
883
884
  ::
885
886
    host metacat metacat 127.0.0.1 255.255.255.255 password
887
888
4. Create a super user. At the command line, enter:
889
890
  ::
891
892
    C:\Program Files\PostgreSQL\8.3\bin
893
    createdb -U postgres metacat (enter super user password)
894
895
5. Log in to PostgreSQL:
896
897
  ::
898
899
    psql -U postgres metacat (enter super user password)
900
901
6. Create a Metacat user:
902
903
  ::
904
905
    CREATE USER metacat WITH UNENCRYPTED PASSWORD 'your_password'
906
907
7. Exit PostgreSQL:
908
909
  ::
910
911
    \q
912
913
8. Restart PostgreSQL from the start menu by selecting:
914
915
  ::
916
917
    run start/All Programs/PostgreSQL 8.3/Stop Server
918
    run start/All Programs/PostgreSQL 8.3/Start Server
919
920
921
9. Test the installation by logging in as the metacat user:
922
923
  ::
924
925
    Psql –U metacat –W –h localhost metacat
926
927
10. Exit PostgreSQL:
928
929
  ::
930
931
    \q
932
933
The Metacat servlet automatically creates the required database schema. For
934
more information, please see Database Configuration.
935
936
Installing Metacat
937
~~~~~~~~~~~~~~~~~~
938
Instructions for a new install and for an upgrade are included below.
939
940
New Install
941
...........
942
Before installing Metacat, please ensure that all required applications are
943
installed, configured to run with Metacat, and running correctly. If you are
944
upgrading an existing Metacat servlet, please skip to Upgrade.
945
946
To install a new Metacat servlet:
947
948
1. Create the Metacat base directory at:
949
950
  ::
951
952
    C:/Program Files/metacat
953
954
2. Copy the Metacat WAR file to Tomcat (for information about obtaining a
955
   Metacat WAR file, see Download Metacat):
956
957
  ::
958
959
    copy <metacat_package_dir>\knb.war C:\Program Files\tomcat\webapps
960
961
3.  Restart Tomcat:
962
963
  ::
964
965
    C:\Program Files\tomcat\shutdown.bat
966
    C:\Program Files\tomcat\startup.bat
967
968
969
Congratulations! You are now ready to configure Metacat. Please see the
970
Configuration Section for more information.
971
972
Upgrade
973
.......
974
To upgrade an existing Metacat installation:
975
976
1. Download and extract the new version of Metacat. For more information about
977
   downloading and extracting Metacat, please see Download Metacat.
978
979
2. Back up the existing Metacat installation. Although not required, we highly
980
   recommend that you back up your existing Metacat to a backup directory
981
   (<backup_dir>) before installing a new version. You can do so by copying:
982
983
  ::
984
985
    <web_app_dir>/knb to <backup_dir>/knb.<yyyymmdd>
986
    <web_app_dir>/knb.war to <backup_dir>/knb.war.<yyyymmdd>
987
988
  Warning: Do not backup the knb directory in the <web_app_dir> directory.
989
  Tomcat will try to run the backup copy as a service.
990
991
3.  Copy the new Metacat WAR file in to Tomcat applications directory:
992
993
  ::
994
995
    copy knb.war C:\Program Files\tomcat\webapps
996
997
4.  Restart Tomcat:
998
999
  ::
1000
1001
    C:\Program Files\tomcat\shutdown.bat
1002
    C:\Program Files\tomcat\startup.bat
1003
1004
Congratulations! You are now ready to configure Metacat. Please see Configuring
1005
Metacat for more information.