Project

General

Profile

metacat / docs / user / metacat / source / install.rst @ 8290

1
Downloading and Installing Metacat
2
==================================
3

    
4
Instructions for both Linux and Windows systems are included in this section.
5

    
6
.. contents::
7

    
8
System Requirements
9
-------------------
10
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

    
14
* 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
* `Java 6`_ (Note: Java 5 is deprecated)
22

    
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
.. _Java 6: http://www.oracle.com/technetwork/java/javaee/overview/index.html
34

    
35
System requirements for running Metacat:
36

    
37
* a server running an SQL92-compliant database (PostgreSQL_ recommended) 
38
* at least 512MB RAM
39
* 200 MB disk space (Note: The amount of disk space required depends on the size of your RDBMS tablespace and the the size and number of documents stored. Metacat itself requires only about 140 MB of free space after installation).
40

    
41

    
42
Installing on Linux
43
-------------------
44
This section contains instructions for downloading and installing Metacat on 
45
Linux systems. As Mac OS X is based on BSD Unix, these Linux instructions can
46
be adapted to also work on Mac OS X (although the exact commands for
47
downloading and installing packages will differ due to the different package
48
management approaches on the Mac).
49

    
50
Quick Start Overview
51
~~~~~~~~~~~~~~~~~~~~
52
For the impatient or those who have already installed Metacat and know what
53
they are doing, here are the steps needed to install Metacat. Detailed
54
instructions for each step are in the next section.
55

    
56
1. Download and install prerequisites (`Java 6`_, `Apache Tomcat`_ 6, PostgreSQL_, `Apache HTTPD Server`_)
57
2. Create a database in PostgreSQL named 'metacat' and authorize access to it in ``pb_hba.conf`` for the user 'metacat'
58
3. Log in to PostgreSQL and create the 'metacat' user
59
4. Download Metacat from the `Metacat Download Page`_ and extract the archive
60
5. ``sudo mkdir /var/metacat; sudo chown -R <tomcat_user> /var/metacat``
61
6. ``sudo cp <metacat_package_dir>/metacat.war <tomcat_app_dir>``
62
7. ``sudo /etc/init.d/tomcat6 restart``
63
8. Configure Metacat through the Web interface
64

    
65
.. _Metacat Download Page: http://knb.ecoinformatics.org/software/metacat/
66

    
67
Downloading Metacat
68
~~~~~~~~~~~~~~~~~~~
69
Before installing Metacat, please ensure that all required software is
70
installed and running correctly. To obtain a Metacat WAR file, which is needed
71
for installation, download one of the following: 
72

    
73
* the Metacat installer, which has a pre-built WAR file,
74
* the Metacat source distribution, which must be built in order to create a WAR file, 
75
* the Metacat source code from SVN. You must build the source code in order to create a WAR file. 
76

    
77
Instructions for all three options are discussed below. Note that downloading
78
the installer (described in the next section) is the simplest way to get
79
started. 
80

    
81
Download the Metacat Installer
82
..............................
83
Downloading the Metacat Installer is the simplest way to get started with the
84
application. To download the installer: 
85

    
86
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., 2.2.0) 
87
2.  Save the file locally. 
88
3.  Extract the Metacat package files by typing:
89

    
90
::
91

    
92
  tar -xvzf metacat-bin-X.X.X.tar.gz
93

    
94
You should see a WAR file and several sample supporting files (Table 2.1). The
95
extraction location will be referred to as the ``<metacat_package_dir>`` for the
96
remainder of this documentation.
97

    
98
================== ===========================================================
99
File               Description
100
================== ===========================================================
101
metacat.war        The Metacat Web archive file (WAR) 
102
metacat-site       Sample Web definition file used by Apache on Ubuntu/Debian 
103
                   Linux systems. 
104
metacat-site-ssl   Sample SSL definition file used by Apache on Ubuntu/Debian 
105
                   Linux systems.
106
jk.conf            Sample JkMount configuration file used by Apache on 
107
                   Ubuntu/Debian Linux systems. 
108
workers.properties Sample workers definition file used by Apache on Ubuntu/Debian 
109
                   Linux systems. 
110
authority.war      The optional LSID Server application WAR
111
================== ===========================================================
112

    
113

    
114
Download Metacat Source Code
115
............................
116
To get the Metacat source distribution:
117

    
118
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., 2.2.0).
119
2. Save the file locally. 
120
3. Extract the Metacat package files by typing (replace X.X.X with the current version number): 
121

    
122
::
123

    
124
  tar -xvzf metacat-src-X.X.X.tar.gz
125

    
126
4. Rename the metacat-X.X.X directory to metacat. 
127

    
128
Note that you do not need to create the WAR file directly because the Ant
129
build-file has an "install" target that will build and deploy the WAR for you. 
130

    
131

    
132
Check Out Metacat Source Code from SVN (for Developers)
133
.......................................................
134

    
135
.. sidebar:: Installing an SVN Client:
136

    
137
    If you have not already installed Subversion and you are running Ubuntu/Debian,
138
    you can get the SVN client by typing:
139
    
140
    ::
141

    
142
        sudo apt-get install subversion
143

    
144
    Otherwise, you can get the SVN client from The Subversion homepage
145
    (http://subversion.tigris.org/).
146
    
147
If you wish to work with the most recent Metacat code, or you'd like to extend
148
the Metacat code yourself, you may wish to check out the Metacat source code
149
from SVN. You will need a Subversion (SVN) client installed and configured on
150
your system (see the end of this section for information about obtaining an SVN
151
client). 
152

    
153
To check out the code from SVN, go to the directory where you would like the
154
code to live and type::
155

    
156
  svn co https://code.ecoinformatics.org/code/metacat/tags/METACAT_<rev> metacat
157

    
158
Where ``<rev>`` is the version of the code you want to check out (like 2_0_0). 
159

    
160
To check out the head, type::
161

    
162
  svn co https://code.ecoinformatics.org/code/metacat/trunk metacat
163

    
164
You should see a list of files as they check out.
165

    
166
Note that you do not need to create the WAR file directly because the Ant
167
build-file has an "install" target that will build and deploy the WAR for you. 
168

    
169

    
170
Installing and Configuring Required Software
171
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172
Before you can install and run Metacat, you must ensure that a recent Java SDK,
173
PostgreSQL (or another SQL92-compliant RDBMS like Oracle), Ant (if
174
installing from source), and Tomcat are installed and running correctly. We
175
also highly recommend that you install Apache Web server, as it provides a more
176
robust Web-serving environment and is required by some Metacat functionality. 
177

    
178
* `Java 6`_
179
* `Apache Tomcat`_ 
180
* `Apache HTTPD Server`_ (Highly Recommended)
181
* PostgreSQL_ Database (or Oracle_)
182
* `Apache Ant`_ (if building from Source)
183

    
184
Java 6
185
......
186
To run Metacat, you should use Java 6 (Java 5 is deprecated and will not be
187
supported after Metacat version 1.9.2). Make sure that the JAVA_HOME
188
environment variable is properly set and that both ``java`` and ``javac`` 
189
are on your PATH. 
190

    
191
To install Java if you are running Ubuntu_/Debian, you can download the appropriate self-extracting installer:: 
192

    
193
  wget http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-x64.bin
194
  
195
and follow these commands to install::
196
  
197
  sudo mkdir -p /opt/java/64
198
  sudo mv jdk-6u30-linux-x64.bin /opt/java/64
199
  cd /opt/java/64
200
  sudo chmod +x jdk-6u30-linux-x64.bin
201
  sudo ./jdk-6u30-linux-x64.bin
202
  sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jdk1.6.0_30/bin/java" 1
203

    
204
You must accept the license agreement during the install process.
205

    
206
If you are not using Ubuntu_/Debian, you can get Java from the Oracle_ website and install using the RPM or other installer (Windows).
207

    
208
.. _Ubuntu: http://www.ubuntu.com/
209

    
210
Apache Tomcat
211
.............
212
We recommend that you install Tomcat 6 into the directory of your choice.
213
Included with the Metacat download is a Tomcat-friendly start-up script that
214
should be installed as well.
215

    
216
Note: we will refer to the Tomcat installation directory as ``<tomcat_home>`` for
217
the remainder of the documentation. 
218

    
219
If you are running Ubuntu_/Debian, get Tomcat by typing::
220

    
221
  sudo apt-get install tomcat6
222

    
223
Otherwise, get Tomcat from the `Apache Tomcat`_ page.
224

    
225
After installing Tomcat, you can switch back to the Sun JDK by typing::
226

    
227
  sudo update-alternatives --config java
228
  
229
and selecting the correct Java installation.
230

    
231
If using Tomcat with Apache/mod_jk, enable the AJP connector on port 8009 by uncommenting that section in::
232

    
233
  <tomcat_home>/conf/server.xml
234
  
235
For DataONE deployments edit::  
236

    
237
	/etc/tomcat6/catalina.properties
238
	
239
to include::
240

    
241
	org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
242
	org.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true
243
	
244
Apache HTTPD Server (Highly Recommended)
245
........................................
246
Although you have the option of running Metacat with only the Tomcat server, we
247
highly recommend that you run it behind the Apache Web server for several
248
reasons; running Tomcat with the Apache server provides a more robust Web
249
serving environment. The Apache Web server is required if you wish to
250
install and run the Metacat Registry or to use the Metacat Replication feature. 
251

    
252
.. sidebar:: Configuring Apache on an OS other than Ubuntu/Debian 
253

    
254
  If you are running on an O/S other than Ubuntu/Debian (e.g., Fedora Core or
255
  RedHat Linux) or if you installed the Apache source or binary, you must
256
  manually edit the Apache configuration file, where <apache_install_dir> is the
257
  directory in which Apache is installed:
258

    
259
  ::
260

    
261
    <apache_install_dir>/conf/httpd.conf
262

    
263
  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:
264

    
265
    ::
266

    
267
      <IfModule mod_jk.c> 
268
        JkLogFile "/var/log/tomcat/mod_jk.log" 
269
        JkLogLevel info 
270
      </IfModule> 
271

    
272
  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:
273

    
274
    ::
275

    
276
      <VirtualHost XXX.XXX.XXX.XXX:80> 
277
        DocumentRoot /var/www 
278
        ServerName dev.nceas.ucsb.edu 
279
        ErrorLog /var/log/httpd/error_log 
280
        CustomLog /var/log/httpd/access_log common 
281
        ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" 
282
        <Directory /var/www/cgi-bin/> 
283
          AllowOverride None 
284
          Options ExecCGI 
285
          Order allow,deny 
286
          Allow from all 
287
        </Directory> 
288
        ScriptAlias /metacat/cgi-bin/ "/var/www/webapps/metacat/cgi-bin/" 
289
        <Directory "/var/www/webapps/metacat/cgi-bin/"> 
290
          AllowOverride None 
291
          Options ExecCGI 
292
          Order allow,deny 
293
          Allow from all 
294
        </Directory> 
295
        JkMount /metacat ajp13 
296
        JkMount /metacat/* ajp13 
297
        JkMount /metacat/metacat ajp13 
298
        JkUnMount /metacat/cgi-bin/* ajp13 
299
        JkMount /*.jsp ajp13 
300
      </VirtualHost> 
301

    
302
  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:
303

    
304
    * the directory in which you extracted the Metacat distribution (for binary distribution)
305
    * <metacat_code_dir>/src/scripts/workers.properties (for both the source distribution and source code checked out from SVN)
306

    
307
  4. Edit the workers.properties file and make sure the following properties are set correctly:
308

    
309
    ::
310

    
311
      workers.tomcat_home -  set to the Tomcat install directory. 
312
      workers.java_home - set to the Java install directory. 
313

    
314
  5. Restart Apache to bring in changes by typing:
315

    
316
    ::
317

    
318
      sudo /etc/init.d/apache2 restart
319

    
320
This section contains instructions for installing and configuring the Apache
321
Web server for Metacat on an Ubuntu_/Debian system. Instructions for configuring
322
Apache running on other Linux systems are included in the sidebar.
323

    
324
1. Install the Apache and Mod JK packages (Mod JK is the module Apache uses to talk to Tomcat applications) by typing:
325

    
326
::
327

    
328
  sudo apt-get install apache2 libapache2-mod-jk
329

    
330
If you are installing the Apache server on an Ubuntu/Debian system, and you
331
installed Apache using apt-get as described above, the Metacat code will have
332
helper files that can be dropped into directories to configure Apache.
333
Depending on whether you are installing from binary distribution or source,
334
these helper files will be in one of two locations: 
335

    
336
* the directory in which you extracted the distribution (for binary distribution)
337
* ``<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>``.
338

    
339
2. Set up Mod JK apache configuration by typing:
340

    
341
::
342

    
343
  sudo cp <metacat_helper_dir>/debian/jk.conf <apache_install_dir>/mods-available
344
  sudo cp <metacat_helper_dir>/debian/workers.properties <apache_install_dir>
345

    
346
3. Disable and re-enable the Apache Mod JK module to pick up the new changes:
347

    
348
::
349

    
350
  sudo a2dismod jk
351
  sudo a2enmod jk
352

    
353
4. Apache needs to know about the Metacat site. The helper file named "metacat-site" has rules that tell Apache which traffic to route to Metacat. Set up Metacat site by dropping the metacat-site file into the sites-available directory and running a2ensite to enable the site:
354

    
355
::
356

    
357
  sudo cp <metacat_helper_dir>/metacat-site <apache_install_dir>/sites-available
358
  sudo a2ensite metacat-site
359
  
360
5. Disable the default Apache site configuration:
361

    
362
::
363

    
364
  sudo a2dissite 000-default  
365

    
366
6. Restart Apache to bring in changes by typing:
367

    
368
::
369

    
370
  sudo /etc/init.d/apache2 restart
371

    
372

    
373
PostgreSQL Database
374
...................
375
Metacat has been most widely tested with PostgreSQL_ and we recommend using it.
376
Instructions for installing and configuring Oracle are also included in the
377
next section.  To install and configure PostgreSQL_:
378

    
379
1. If you are running Ubuntu_/Debian, get PostgreSQL by typing:
380

    
381
  ::
382

    
383
    sudo apt-get install postgresql
384

    
385
  On other systems, install the rpms for postgres.
386

    
387
2. Start the database by running:
388

    
389
  ::
390

    
391
    sudo /etc/init.d/postgresql-8.4 start
392

    
393
3. Change to postgres user: 
394

    
395
  ::
396

    
397
    sudo su - postgres
398

    
399

    
400
4. Set up an empty Metacat database instance by editing the postgreSQL configuration file: 
401

    
402
  ::
403

    
404
    gedit /etc/postgresql/8.4/main/pg_hba.conf
405

    
406

    
407
  Add the following line to the configuration file: 
408

    
409
  ::
410

    
411
    host metacat metacat 127.0.0.1 255.255.255.255 password
412

    
413

    
414
  Save the file and then create the Metacat instance: 
415

    
416
  ::
417

    
418
    createdb metacat
419

    
420

    
421
5. Log in to postgreSQL by typing: 
422

    
423
  ::
424

    
425
    psql metacat
426

    
427

    
428
6. At the psql prompt, create the Metacat user by typing:
429

    
430
  ::
431

    
432
    CREATE USER metacat WITH UNENCRYPTED PASSWORD 'your_password';
433

    
434
  where 'your_password' is whatever password you would like for the Metacat user. 
435

    
436
7. Exit PostgreSQL by typing 
437

    
438
  ::
439

    
440
    \q
441

    
442
8. Restart the PostgreSQL database to bring in changes: 
443

    
444
  ::
445

    
446
    /etc/init.d/postgresql-8.4 restart
447

    
448
9. Log out of the postgres user account by typing: 
449

    
450
  ::
451

    
452
    logout
453

    
454
10. Test the installation and Metacat account by typing: 
455

    
456
  ::
457

    
458
    psql -U metacat -W -h localhost metacat
459

    
460
11. Log out of postgreSQL: 
461

    
462
  ::
463

    
464
    \q
465

    
466

    
467
The Metacat servlet automatically creates the required database schema. For
468
more information about configuring the database, please see Database
469
Configuration.
470

    
471
Installing and Configuring Oracle
472
.................................
473
To use Oracle with Metacat, the Oracle RDBMS must be installed and running
474
as a daemon on the system. In addition the JDBC listener must be enabled.
475
Enable it by logging in as an Oracle user and typing::
476

    
477
  lsnrctl start
478

    
479
Your instance should have a table space of at least 5 MB (10 MB or higher
480
recommended). You must also create and enable a username specific to Metacat.
481
The Metacat user must have most normal permissions including: CREATE SESSION,
482
CREATE TABLE, CREATE INDEX, CREATE TRIGGER, EXECUTE PROCEDURE, EXECUTE TYPE,
483
etc. If an action is unexplainably rejected by Metacat, the user permissions
484
are (most likely) not correctly set.
485

    
486
The Metacat servlet automatically creates the required database schema. For
487
more information, please see Database Configuration.
488

    
489
Apache Ant (if building from Source)
490
....................................
491
If you are building Metacat from a source distribution or from source code
492
checked out from SVN, Ant is required. (Users installing Metacat from the
493
binary distribution do not require it.) Ant is a Java-based build application
494
similar to Make on UNIX systems. It takes build instructions from a file named
495
"build.xml", which is found in the root installation directory. Metacat source
496
code comes with a default "build.xml" file that may require some modification
497
upon installation. 
498

    
499
If you are running Ubuntu/Debian, get Ant by typing::
500

    
501
  sudo apt-get install ant
502

    
503
Otherwise, get Ant from the `Apache Ant`_ homepage.
504

    
505
Ant should be installed on your system and the "ant" executable shell script
506
should be available in the user's path. The latest Metacat release was tested
507
with Ant 1.8.2. 
508

    
509
Installing Metacat
510
~~~~~~~~~~~~~~~~~~
511
Instructions for a new install, an upgrade, and a source install are included
512
below.
513

    
514
New Install
515
...........
516
Before installing Metacat, please ensure that all required applications are
517
installed, configured to run with Metacat, and running correctly. If you are
518
upgrading an existing Metacat servlet, please skip to Upgrade. For information
519
about installing from source, skip to Source Install and Upgrade.
520

    
521
To install a new Metacat servlet:
522

    
523
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:
524

    
525
  ::
526

    
527
    sudo mkdir /var/metacat
528

    
529
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):
530

    
531
  ::
532

    
533
    sudo chown -R <tomcat_user> /var/metacat
534

    
535

    
536
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., metacat.war) provides the application context, which appears in the URL of the Metacat (e.g., http://yourserver.com/metacat/). To change the context, simply change the name of the WAR file to the desired name before copying it.  To install the Metacat WAR:
537

    
538
  ::
539

    
540
    sudo cp <metacat_package_dir>/metacat.war <tomcat_app_dir>
541

    
542

    
543
4. Restart Tomcat. Log in as the user that runs your Tomcat server (often "tomcat") and type:  
544

    
545
  ::
546

    
547
    sudo /etc/init.d/tomcat6 restart
548

    
549
Congratulations! You have now installed Metacat. If everything is installed
550
correctly, you should see the Authentication Configuration screen (Figure 2.1)
551
when you type http://yourserver.com/yourcontext/ (e.g.,
552
http://knb.ecoinformatics.org/knb) into a browser. For more information about
553
configuring Metacat, please see the Configuration Section.
554

    
555
.. figure:: images/screenshots/image009.png
556
   :align: center
557

    
558
   The Authentication Configuration screen appears the first time you open a 
559
   new installation of Metacat. 
560

    
561
Upgrade Metacat
562
...............
563
To upgrade an existing binary Metacat installation follow the steps in this
564
section. The steps for upgrading Metacat from source are the same as the
565
instructions for installing from source:
566

    
567
1. Download and extract the new version of Metacat. For more information about downloading and extracting Metacat, please see Downloading Metacat.
568

    
569
2. Stop running Metacat. To stop Metacat, log in as the user that runs your Tomcat server (often "tomcat") and type:
570

    
571
  ::
572

    
573
    /etc/init.d/tomcat6 stop
574

    
575
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:
576

    
577
  ::
578

    
579
    cp <web_app_dir>/metacat <backup_dir>/metacat.<yyyymmdd>
580
    cp <web_app_dir>/metacat.war <backup_dir>/metacat.war.<yyyymmdd>
581

    
582
  Warning: Do not backup the files to the ``<web_app_dir>`` directory.  Tomcat will
583
  try to run the backup copy as a service.
584

    
585
4. Copy the new Metacat WAR file in to the Tomcat applications directory: 
586

    
587
  ::
588

    
589
    sudo cp <metacat_package_dir>/metacat.war <tomcat_app_dir>
590

    
591
  Note: Typically, Tomcat will look for its application files (WAR files) in the
592
  ``<tomcat_home>/webapps`` directory. Your instance of Tomcat may be configured to
593
  look in a different directory. 
594

    
595
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. 
596

    
597
  ::
598
   
599
    sudo cp <metacat_package_dir>/authority.war <tomcat_app_dir>
600

    
601
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:  
602

    
603
  ::
604

    
605
    /etc/init.d/tomcat6 restart
606

    
607

    
608
7. Run your new Metacat servlet. Go to a Web browser and visit your installed
609
Metacat application, using a URL of the form: 
610

    
611
  ::
612

    
613
    http://yourserver.yourdomain.com/yourcontext/
614

    
615
You should substitute your context name for "yourcontext" in the URL above
616
(your context will be "metacat" unless you change the name of the metacat.war file to
617
something else). If everything is working correctly, you should be presented
618
with Metacat's Authorization Configuration screen. Note that if you do not have
619
Tomcat integrated with Apache you will probably have to type
620
http://yourserver.yourdomain.com:8080/yourcontext/
621

    
622
Source Install and Upgrade
623
..........................
624
Whether you are building Metacat from the source distribution or source code
625
checked out from SVN, you will need Apache Ant to do the build (see Installing
626
and Configuring Required Software for more information about Ant). 
627

    
628
To install Metacat from source:
629

    
630
1. Edit the build.properties file found in the directory in which you
631
   downloaded Metacat. Note: Throughout the instructions, we will refer to this
632
   directory as ``<metacat_src_dir>``. 
633

    
634
  * Set the build.tomcat.dir property to your Tomcat installation directory.
635
    Metacat will use some of the native Tomcat libraries during the build. For
636
    instance: build.tomcat.dir=/usr/local/tomcat
637
  * Set the app.deploy.dir property to your application deployment directory.
638
    For instance: app.deploy.dir=/usr/local/tomcat/webapps
639

    
640
2. In the ``<metacat_src_dir>``, run: 
641

    
642
  ::
643

    
644
    sudo ant clean install
645

    
646
  You will see the individual modules get built. You should see a "BUILD
647
  SUCCESSFUL" message at the end.
648

    
649
  You should see a new file named metacat.war in your application deployment
650
  directory.
651

    
652
To run your new Metacat servlet, open a Web browser and type::
653

    
654
  http://yourserver.yourdomain.com/yourcontext/ 
655
  (e.g.  http://knb.ecoinformatics.org/metacat/)
656

    
657
Your context will be "metacat" unless you changed the name of the metacat.war file to
658
something else. The servlet may require a few seconds to start up, but once it
659
is running, you will be presented with the Authorization Configuration screen.
660

    
661
Optional Installation Options (LSID Server)
662
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
663

    
664
.. Note::
665

    
666
  The support for LSID identifiers is deprecated, and is being replaced with
667
  support for DOI_ identifiers in a future release. We are maintaining support
668
  for LSIDs on one particular site, but this support will be removed in a
669
  future version of Metacat.
670

    
671
.. _DOI: http://www.doi.org/
672

    
673
Metacat's optional LSID server allows Metacat to use a standardized syntax for
674
identifying data sets, in addition to Metacat's internal, custom scheme for
675
identifiers. LSID's were designed to identify complex biological entities with
676
short identifiers (much like DOIs in publishing) that are both computer and
677
human readable. LSID identifiers are URIs and are therefore usable in many
678
Internet applications, but they also cleanly separate the identity of a data
679
set (i.e., its permenant identifier) from its current location (e.g., the list
680
of URLs from which it might be retrieved).  LSIDs accomplish this by using a
681
level of indirection; the identifier represents simply a name without location,
682
but an associated resolver service can be used to locate the current location
683
of the data and medata for the data set.  This is accomplished by establishing
684
a well-known location for the resolution service for each authority using an
685
infrequently used feature of the domain name system called SRV records.  At its
686
most basic, resolution of an identifier is performed when a client looks up the
687
SRV record for an LSID by querying DNS, which returns the current host and port
688
of the authority web service, which is in turn used to locate the data and
689
metadata.
690

    
691
Using LSIDs to identify data records is being debated among members of the
692
Taxonomic Databases Working Group (TDWG).  There are several alternate
693
technologies that are under consideration (e.g., DOI_, plain http URIs), and so
694
at this time the support for LSIDs in Metacat has been created on an
695
experimental basis only.  If the LSID approach is ratified by the broader
696
community, we will expand support for LSIDs in Metacat, but until then it is an
697
optional and experimental feature.
698

    
699
The format of an LSID is:: 
700

    
701
  urn:lsid:<Authority>:<Namespace>:<ObjectID>[:<Version>]
702
  e.g., urn:lsid:ecoinformatics.org:tao:12039:1
703

    
704
When you enable the Metacat LSID support, you can use LSID clients (such as
705
LSID Launchpad) and LSID notation to query Metacat for data and metadata. LSID
706
notation can be used directly in Metacat HTTP queries as well. For example, a
707
data package with an ID tao.12039.1 that is stored in a Metacat available at:
708
http://example.com:9999 can be accessed by the following HTTP Metacat queries::
709

    
710
  http://example.com:9999/authority/data?lsid=urn:lsid:ecoinformatics.org:tao:12039:1
711
  (To return the data)
712

    
713
  http://example.com:9999/authority/metadata?lsid=urn:lsid:ecoinformatics.org:tao:12039:1
714
  (To return the metadata)
715

    
716
Notice that in the HTTP query strings, the periods in the data package ID have
717
been replaced with colons. The authority (ecoinformatics.org) must be properly
718
configured by the Metacat administrator. Note: In order to configure the
719
authority, you must have access to the DNS server for the Metacat domain.
720
Further instructions are provided below.
721

    
722
Install and configure the LSID Server shipped with Metacat
723
..........................................................
724

    
725
To install the LSID server using the binary installation:
726

    
727
1. Copy the authority.war file to Tomcat:
728

    
729
  ::
730

    
731
    sudo cp <metacat_package_directory>/authority.war /usr/share/tomcat6/webapps
732
 
733
2. Set up the LSID server by dropping the authority file into Apache's
734
   sites-available directory and running a2ensite to enable the site:
735

    
736
   ::
737

    
738
     sudo cp <metacat_helper_dir>/authority /etc/apache2/sites-available
739
     sudo a2ensite authority
740

    
741
3. Restart Tomcat. Log in as the user that runs your Tomcat server (often
742
   "tomcat") and type:
743

    
744
   ::
745

    
746
     /etc/init.d/tomcat5.5 restart
747

    
748
4. Restart Apache to bring in changes by typing:
749

    
750
  ::
751

    
752
    sudo /etc/init.d/apache2 restart
753

    
754
5. See notes beneath LSID server source installation for instructions for
755
   modifying the SRV record(s)
756

    
757
To install the LSID server from a source
758
........................................
759

    
760
1. In the build.properties file found in the directory into which you
761
   extracted the Metacat source code, set the authority and config.lsidauthority
762
   properties. For example:
763
  
764
  ::
765
   
766
   authority.context=authority
767
   config.lsidauthority=ecoinformatics.org
768

    
769
2. In the <metacat-src-dirctory> create the authority.war by running:
770

    
771
  ::
772

    
773
    sudo ant war-lsid
774

    
775
3. Copy the LSID WAR file into the Tomcat application directory.
776

    
777
  ::
778

    
779
    sudo cp <metacat_package_dir>/dist/authority.war <tomcat_app_dir>
780

    
781
4. Restart Tomcat. Log in as the user that runs your Tomcat server (often
782
   "tomcat") and type:   
783

    
784
  ::
785

    
786
    /etc/init.d/tomcat6 restart
787

    
788
5. If you are running Tomcat behind the Apache server (the recommended
789
   configuration), set up and enable the authority service site configurations by
790
   typing:
791

    
792
  ::
793

    
794
    sudo cp <metacat_helper_dir>/authority <apache_install_dir>/sites-available
795
    sudo a2ensite authority
796

    
797
  Where <metacat_helper_dir> can be found in <metacat_code_dir>/src/scripts
798

    
799
6.  Restart Apache to bring in changes by typing: 
800

    
801
  ::
802

    
803
    sudo /etc/init.d/apache2 restart
804

    
805
  Once the authority.war is installed, you must also modify the SRV record(s)
806
  on the DNS server for the domain hosting the Metacat. The record should be
807
  added to the master zone file for the metacat's DNS server:
808

    
809
    ::
810

    
811
      _lsid._tcp      IN      SRV     1       0       8080    <metacat.edu>.
812

    
813
  Where <metacat.edu> is the name of the machine that will serve as the
814
  physical location of the AuthorityService.
815

    
816
  For example, the value of <metacat.edu> for the below example URL would be
817
  example.com:
818
  
819
    ::
820
    
821
      http://example.com:9999/authority/data?lsid=urn:lsid:ecoinformatics.org:tao:12039:1
822

    
823
  For more information, please see http://www.ibm.com/developerworks/opensource/library/os-lsid/
824

    
825
Troubleshooting
826
~~~~~~~~~~~~~~~
827
We keep and update a list of common problems and their solutions on the KNB
828
website. See http://knb.ecoinformatics.org/software/metacat/troubleshooting.html 
829
for more information.
830

    
831
Installing on Windows
832
---------------------
833
Metacat can be installed on Windows. Please follow the instructions in this
834
section for downloading Metacat, installing the required software, and
835
installing Metacat. Note that Registry and Data Upload functionality has not
836
been tested on Windows.
837

    
838
Download Metacat
839
~~~~~~~~~~~~~~~~
840
To obtain a Metacat WAR file, which is used when installing the Metacat
841
servlet:
842

    
843
1. Browse to the KNB Software Download Page. In the Metacat section, select
844
   the link that looks like: metacat-bin-X.X.X.zip, where X.X.X is the latest
845
   version of Metacat (e.g., 2.0.4).
846

    
847
2. Choose to download and Save the file locally. 
848

    
849
3. Extract the Metacat package files using your Windows zip utility. You
850
   should see a WAR file and several supporting files (we will only use the WAR
851
   file when installing Metacat). 
852

    
853
Note: The location where these files were extracted will be referred to as the
854
``<metacat_package_dir>`` for the remainder of this documentation. 
855

    
856
Note: Before installing Metacat, please ensure that all required software is
857
installed and running correctly.
858

    
859

    
860
Install Required Software
861
~~~~~~~~~~~~~~~~~~~~~~~~~
862
Before you can install and run Metacat, you must ensure that a recent Java SDK,
863
PostgreSQL and Tomcat are installed, configured, and running correctly. 
864

    
865
* `Java 6`_
866
* `Apache Tomcat`_
867
* PostgreSQL_ Database
868

    
869
Java 6
870
......
871
To run Metacat, you must have Java 6. (Java 5 is deprecated). Make sure that
872
the JAVA_HOME environment variable is properly set and that both java and javac
873
are on your PATH.
874

    
875
To download and install Java:
876

    
877
1. Browse to: http://java.sun.com/javase/downloads/widget/jdk6.jsp and follow
878
   the instructions to download JDK 6.
879

    
880
2. Run the downloaded installer to install Java.
881

    
882
3. Set the JAVA_HOME environment variable: In "My Computer" properties, go to
883
   "advanced settings > environment variables". Add:
884

    
885
  ::
886

    
887
    System Variable: JAVA_HOME C:\Program Files\Java\jdk1.6.0_18 
888
    (or whichever version you downloaded)
889

    
890
Apache Tomcat
891
.............
892
We recommend that you install Tomcat version 6.  To download and install Tomcat:
893

    
894
1. Browse to: http://tomcat.apache.org/
895
2. Download the Tomcat core zip file 
896
3. Extract Tomcat files to C:\Program Files\tomcat using the windows zip
897
   utility. 
898

    
899
PostgreSQL Database
900
...................
901
Metacat can be run with several SQL92-compliant database systems, but it has 
902
been most widely tested with PostgreSQL_. Instructions for installing and 
903
configuring PostgreSQL for use with Metacat are included in this section.
904

    
905
To download and install PostgreSQL:
906

    
907
1. Browse to http://www.postgresql.org/download/windows and download the
908
   one-click installer 
909
2. Run the installer 
910
3. Edit C:\Program Files\PostgreSQL\8.3\data and add:
911
  
912
  ::
913

    
914
    host metacat metacat 127.0.0.1 255.255.255.255 password
915

    
916
4. Create a super user. At the command line, enter:
917

    
918
  ::
919

    
920
    C:\Program Files\PostgreSQL\8.3\bin 
921
    createdb -U postgres metacat (enter super user password)
922

    
923
5. Log in to PostgreSQL: 
924

    
925
  ::
926

    
927
    psql -U postgres metacat (enter super user password)
928

    
929
6. Create a Metacat user:
930

    
931
  ::
932

    
933
    CREATE USER metacat WITH UNENCRYPTED PASSWORD 'your_password'
934

    
935
7. Exit PostgreSQL: 
936

    
937
  ::
938

    
939
    \q
940

    
941
8. Restart PostgreSQL from the start menu by selecting:
942
  
943
  ::
944

    
945
    run start/All Programs/PostgreSQL 8.3/Stop Server
946
    run start/All Programs/PostgreSQL 8.3/Start Server
947

    
948

    
949
9. Test the installation by logging in as the metacat user: 
950

    
951
  ::
952
  
953
    psql -U metacat -W -h localhost metacat
954

    
955
10. Exit PostgreSQL:
956

    
957
  ::
958

    
959
    \q
960

    
961
The Metacat servlet automatically creates the required database schema. For
962
more information, please see Database Configuration.
963

    
964
Installing Metacat
965
~~~~~~~~~~~~~~~~~~
966
Instructions for a new install and for an upgrade are included below.
967

    
968
New Install
969
...........
970
Before installing Metacat, please ensure that all required applications are
971
installed, configured to run with Metacat, and running correctly. If you are
972
upgrading an existing Metacat servlet, please skip to Upgrade.
973

    
974
To install a new Metacat servlet:
975

    
976
1. Create the Metacat base directory at: 
977

    
978
  ::
979

    
980
    C:/Program Files/metacat
981

    
982
2. Copy the Metacat WAR file to Tomcat (for information about obtaining a
983
   Metacat WAR file, see Download Metacat): 
984
  
985
  ::
986

    
987
    copy <metacat_package_dir>\metacat.war C:\Program Files\tomcat\webapps
988

    
989
3.  Restart Tomcat: 
990

    
991
  ::
992

    
993
    C:\Program Files\tomcat\shutdown.bat
994
    C:\Program Files\tomcat\startup.bat
995

    
996

    
997
Congratulations! You are now ready to configure Metacat. Please see the
998
Configuration Section for more information. 
999

    
1000
Upgrade
1001
.......
1002
To upgrade an existing Metacat installation:
1003

    
1004
1. Download and extract the new version of Metacat. For more information about
1005
   downloading and extracting Metacat, please see Download Metacat.
1006

    
1007
2. Back up the existing Metacat installation. Although not required, we highly
1008
   recommend that you back up your existing Metacat to a backup directory 
1009
   (<backup_dir>) before installing a new version. You can do so by copying:
1010

    
1011
  ::
1012

    
1013
    <web_app_dir>/metacat to <backup_dir>/metacat.<yyyymmdd>
1014
    <web_app_dir>/metacat.war to <backup_dir>/metacat.war.<yyyymmdd>
1015

    
1016
  Warning: Do not backup the metacat directory in the <web_app_dir> directory.
1017
  Tomcat will try to run the backup copy as a service.
1018

    
1019
3.  Copy the new Metacat WAR file in to Tomcat applications directory: 
1020

    
1021
  ::
1022

    
1023
    copy metacat.war C:\Program Files\tomcat\webapps
1024

    
1025
4.  Restart Tomcat: 
1026
  
1027
  ::
1028
  
1029
    C:\Program Files\tomcat\shutdown.bat
1030
    C:\Program Files\tomcat\startup.bat
1031

    
1032
Congratulations! You are now ready to configure Metacat. Please see Configuring
1033
Metacat for more information.
1034