DataServices/OPeNDAP-TDS-Install

Installing the THREDDS Data Server

If you are installing this on a server with a  http://projects.arcs.org.au/trac/davis/ Davis], please use this guide: Installling TDS with Davis.

To install the THREDDS Data Server, you will install Java 1.6.0+ and Jetty 6.x first.

Installing Java

  • Download the Java JDK - make sure you select version 1.6.0 or above! The reason for running Java 1.6 is because the new THREDDS Data Server uses some new classes in the Java 1.6 Framwork. The developers have indicated that Java 1.6 has better performance over 1.5.
http://java.sun.com/javase/downloads/index.jsp 
  • Select the correct version for your system and download the rpm bin version.
  • As the root user, modify permission and run the installer
chmod a+x jdk-6u12-linux-i586-rpm.bin
./jdk-6u12-linux-i586-rpm.bin
mv jdk1.6.0_12/ /usr/java/
  • Agree to the license terms (type in "yes") and continue with the installation
  • Java 1.6 is now installed!
  • To verify, type in "java -version" and it should print out Java version information. If it doesn't show Java 1.6, and you would like to make it the default version, please follow the instructions below.

To following bit of instructions will make Java 1.6 the default version.

  • As root:
    rm -f /var/lib/alternatives/java
    /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_12/bin/java 2
    /usr/sbin/alternatives --config java
    
  • Type in the number is associated with the jdk1.6.0 path

Installing Jetty 6

  • As root, unzip the package in /opt. /opt/jetty-6.1.15 is the Jetty home directory
unzip jetty-6.1.15.zip -d /opt/
export JETTY_HOME=/opt/jetty-6.1.15/
  • It is recommended that you do not run Jetty as root. In order to run Jetty as another user, either use an existing account or create another user.

  • Add another user and modify the ownership of the unzipped directory to jetty.
    /usr/sbin/useradd jetty -d /opt/jetty-6.1.15
    chown -R jetty:jetty /opt/jetty-6.1.15/
    
  • Download and install Maven2. As root:
    cd /tmp
    wget http://apache.mirror.aussiehq.net.au/maven/binaries/apache-maven-2.0.10-bin.tar.gz
    tar -zxvf /tmp/apache-maven-2.0.10-bin.tar.gz -C /opt/
    
  • Install Jetty Setuid utility. As jetty:
    export JAVA_HOME=/usr/java/jdk1.6.0_12/
    export PATH=$PATH:/usr/java/jdk1.6.0_12/bin/:/opt/apache-maven-2.0.10/bin/
    cd /opt/jetty-6.1.15/extras/setuid/
    mvn install
    mkdir -p modules/native/target/generated
    javah -d modules/native/target/generated -classpath modules/java/target/jetty-setuid-java-6.1.15.jar org.mortbay.setuid.SetUID
    
    gcc -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/  \
           -shared modules/native/target/generated/org_mortbay_setuid_SetUID.c -o \
           ../../lib/ext/libsetuid.so
    
    
  • Modify the $JETTY_HOME/etc/jetty-setuid.xml with a the uid and gid of the user you would like to run Jetty as.

E.g.

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">


<!-- =============================================================== -->
<!-- Configure the Jetty SetUIDServer                                 -->
<!-- this configuration file should be used in combination with      -->
<!-- other configuration files.  e.g.                                -->
<!--    java -jar start.jar etc/jetty-setuid.xml etc/jetty.xml       -->
<!-- =============================================================== -->
<Configure id="Server" class="org.mortbay.setuid.SetUIDServer">
  <Set name="startServerAsPrivileged">false</Set>
  <Set name="umask">026</Set>
  <Set name="uid">501</Set>
  <Set name="gid">501</Set>
</Configure>
  • As root, start your server like so:
    java -DSTOP.PORT=8079 -DSTOP.KEY=secret -jar start.jar $JETTY_HOME/etc/jetty-setuid.xml $JETTY_HOME/etc/jetty.xml
    
  • Double check that it is running as jetty, it should be something like the following:
    jetty     7399 18.2  5.5 224764 28524 pts/2    Sl+  01:52   0:01 java -jar start.jar /opt/jetty-6.1.15//etc/jetty-setuid.xml /opt/jetty-6.1.15/etc/jetty.xml
    

Installing THREDDS Data Server

  • Copy this to Jetty's webapps directory and restart the server As jetty:
    unzip thredds.war -d $JETTY_HOME/webapps/thredds/
    
  • Then restart the server. If you have installed Jetty using the /etc/init.d/tds script, then you can simply do:
    /etc/init.d/tds restart
    

or, you can run the java command from $JETTY_HOME

java -DSTOP.PORT=8079 -DSTOP.KEY=secret -jar start.jar --stop
java -DSTOP.PORT=8079 -DSTOP.KEY=secret -jar start.jar $JETTY_HOME/etc/jetty-setuid.xml $JETTY_HOME/etc/jetty.xml
  • Load TDS in your browser. You should be able to see three links (Test Single Dataset, Test all files in a directory and Test Enhanced Catalog)
    http://<yourhost>:8080/thredds
    
  • TDS has is now installed!

To configure the catalog.xml file, please refer to Configuring TDS or the TDS Admin  here

Authenticated Datasets using Shibboleth

The following link contains documentation on how to protect TDS using Apache and Shibboleth. You only need to do this if the datasets you are using requires authentication.

Installing TDS with mod_shib