Metacat Installation - Registry
|
|||||||
KNB Home | Data | People | Informatics | Biocomplexity | Education | Software |
Installing the Metacat Registry |
|
Author: Shaun Walbridge Date: 06/06/2008 |
The Metacat Registry provides an easy mechanism to create and edit simple EML metadata documents, and accounts for your Metacat users. It is an optional component of Metacat, but is useful when you need very low barriers to creating simple EML, or have users unable to use Morpho. The LDAP account management interface is useful if you are authenticating users against LDAP, and need to provide a basic mechanism for managing user accounts.
The Registry can be installed on any machine Metacat runs on, but does require additional legwork to get it installed. It requires that Metacat is set deployed behind Apache, as our recommended installation platform, and the instructions assume Apache is already installed and working correctly.
Download and extract the Metacat release:
mkdir metacat && cd metacat
wget http://knb.ecoinformatics.org/software/dist/metacat-src-1.8.0.zip
unzip metacat-src-1.8.0.zip
cd metacat-1.8.0
export METACAT=`pwd`
Build the Metacat Perl client library:
cd $METACAT/src/perl/Metacat
perl Makefile.PL
make
sudo make install
Install the system libraries needed. On Redhat:
sudo yum install gcc libxml2-devel libxslt-devel ant -y
On Debian:
sudo apt-get install ant -y
If on Debian, skip ahead to step 7.
Install CPAN, which allows us to install the Perl dependencies for the registry and account management parts of Metacat. If asked to manually configure cpan, type 'no' and CPAN will be setup with its default values.
sudo yum install perl-CPAN
sudo cpan
You should now see a prompt which looks like:
cpan>
The rest of the commands will assume you're inside of CPAN. Let's get the most recent version of the CPAN software. Just press return after any prompts you recieve during this process.
install Bundle::CPAN
reload cpan`
Install the required modules. Here we're installing an old LibXSLT, as the current one requires a newer libxslt than is available on Redhat 4 & 5. Again, just answer 'yes' to any questions.
install AutoLoader
install CGI
install CGI::SEssion
install LDAP::UserAgent
install Net::LDAP
install Template
install URI
install MSERGEANT/XML-LibXSLT-1.58.tar.gz
As part of the Metacat setup, a property called 'inst.cgi.dir' is set, which controls the location the perl scripts will be installed into, with a default of '/var/www/cgi-knb'. To install the registry and the account manager to this folder we'll run ant:
cd $METACAT
sudo ant install-registry
sudo ant insall-ldap
A registry instance can support one or more skins. Skins
provide a mechanism for giving a custom look to your Metacat
installation, but require integration work to initially
create. For this example, we'll use the nceas
skin provided with Metacat. First, we'll want to install the
skin:
sudo ant install-skin
When prompted, type nceas
.
Metacat uses the 'temp-dir' property to set a temporary
space to store uploaded files. If you'd like your registry to
allow file uploads, we'll need to make sure Apache can write
to it. The apache user varies from machine to machine, but
typically it will be either www-data
or
apache
. Once finding your appropriate apache
user, we'll want to change ownership of a few files, here
using the user apache
:
sudo chown apache /tmp/knb
Each skin has a 'lastid' file, which controls which the accession numbers metacat generates. As with the temporary folder, we'll want the registry to be able to write to this file, replacing the skin name with the skin you're planning on using:
sudo touch /var/www/org.ecoinformatics.knb/knb/style/skins/nceas/nceas.lastid
sudo chown apache /var/www/org.ecoinformatics.knb/knb/style/skins/nceas/nceas.lastid
You'll need to have one lastid file for each skin your site will support.
Configure Apache to serve up the pages we've just configured. In your httpd.conf or equivalent, add:
ScriptAlias /cgi-bin/ "/var/www/cgi-knb/"
<Directory "/var/www/cgi-knb">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>`
Then reload Apache:
/etc/init.d/httpd reload
Change owner and access permission of some credential files:
cd /webapps/knb/style/skins/
find . -name "*.cfg" -exec chmod 600 {} \;
find . -name "*.cfg" -exec chown apache {} \;
Note: "/webapps/knb" is subject to change base on your configuration.
"apache" user is the one who runs httpd server.
Those commands will make the files which contain credentials are not accessible from web browsers.Now visit the resulting URL:
http://localhost/cgi-bin/register-dataset.cgi?cfg=nceas
If everything worked correctly, you should see a page like this:
These are special instructions required for the NCEAS skin to get a current projects list from the AdminDB, and can safely be ignored in all other uses.
Download and install the Oracle Instant Client RPMs. These can be obtained from the oracle website.
rpm -i oracle-instantclient-basic-10.2.0.3-1.i386.rpm
rpm -i oracle-instantclient-devel-10.2.0.3-1.i386.rpm
rpm -i oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm
Next, we'll need an tnsnames.ora
file for
Oracle to locate the server we're connecting to. In this
example, we'll copy it from a remote location:
mkdir -p /usr/lib/oracle/10.2.0.3/network/admin/ && cd !$
scp walbridge@knb.ecoinformatics.org:/usr/lib/oracle/10.1.0.4/network/admin/tnsnames.ora .
The AdminDB is accessed via Perl, so install the needed Oracle driver using CPAN:
cpan
install DBI
install DBD::Oracle
Now we can install the AdminDB module itself:
mkdir -p ~/projects/admindb && cd !$
export CVSROOT=:ext:walbridge@cvs.nceas.ucsb.edu:/cvsnceas
cvs co admindb
cd admindb/perl/NCEAS/AdminDB
perl Makefile.PL
make
sudo make install
Finally, set the correct properties in the
nceas.cfg
file:
nceas_db = //hyperion.nceas.ucsb.edu:1521/nceasp.nceas.ucsb.edu
nceas_db_user = admowner
nceas_db_password = NCEAS_DB_READ_PASSWORD_HERE
A quick check of register-dataset.cgi
should
now show a complete list of projects:
Redhat based, tested on Centos 5
Debian based, tested on Ubuntu 8.04