Metacat Install - Ubuntu
KNB Home Data People Informatics Biocomplexity Education Software

Installing Metacat on Ubuntu

Assumes you have the base ubuntu distribution set up already.

Repositories

* Add the extra repositories to your apt sources list. 
    sudo gedit /etc/apt/sources.list
    # add universe and multiverse to the following lines
       deb http://us.archive.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
       deb-src http://us.archive.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
    sudo apt-get update

Ubuntu Package Dependencies

* Install the ubuntu package dependencies
    sudo apt-get install tomcat5-webapps postgresql-server-dev-8.1 postgresql-8.1 sun-java5-jdk \
                         apache2 cvs 

java jdk

* Tell the ubuntu system to use the java jdk 
    sudo update-java-alternatives -s java-1.5.0-sun

    sudo vi /etc/default/tomcat5
      JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
      .......
      CATALINA_OPTS="-Djava.awt.headless=true -Djava.util.prefs.syncInterval=2000000 -Xmx512M -server"
      ....
      TOMCAT_SECURITY=no

    sudo /etc/init.d/tomcat5 restart

Checkout Metacat

* Download metacat from CVS and set up utilites     
    
    mkdir ~/workspace; cd ~/workspace
    cvs -d:ext:perry@cvs.ecoinformatics.org:/cvs co metacat
    cvs -d:ext:perry@cvs.ecoinformatics.org:/cvs co utilities
    cd utilities
    ant clean jar
    cd ../metacat

prep postgres

    # Setting up the postgres metacat db
    sudo vi /etc/postgresql/8.1/main/pg_hba.conf
    # add 
      host metacat metacat 127.0.0.1 255.255.255.255 password
    sudo su postgres
    createdb metacat
    psql -d metacat
      create user metacat with unencrypted password 'metacatpass';
      \q
    exit

restart postgres

    sudo /etc/init.d/postgresql-8.1 restart
 
    # TEST
    psql -U metacat -W -h localhost metacat

Build

   sudo touch /var/lib/tomcat5/webapps/knb.war
   sudo chown perry /var/lib/tomcat5/webapps/knb.war
   cd ~/workspace/metacat
   cp build.properties default.build.properties
   # Edit build.properties 
   vi lib/metacat.properties

   #change
     onlySecureLDAPConnection=false
   # TODO set up the certificate *********

   ant clean install
   # may need to give cvs password a few times on the first build

Postgres configuration

   psql -U metacat -W -h localhost -f build/src/xmltables-postgres.sql metacat
   ant register-schemas

apache / tomcat integration

    #the instructions at http://www.ubuntuforums.org/showthread.php?t=219985 cover this pretty well
    #remember to add the 'knb' servlet context
 
* Make sure metacat_data and metacat_inline_data folders are readable/writable by tomcat user