= 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: [wiki:tds_with_davis 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 == * Download Jetty 6: {{{ wget http://dist.codehaus.org/jetty/jetty-6.1.15/jetty-6.1.15.zip }}} * Jetty install instructions: http://docs.codehaus.org/display/JETTY/Installing+Jetty-6.1.x * 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. {{{ false 026 501 501 }}} * 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 == * As the jetty user, download the latest '''dev''' version from UCAR (http://www.unidata.ucar.edu/projects/THREDDS/tech/TDS.html) {{{ wget ftp://ftp.unidata.ucar.edu/pub/thredds/4.0/thredds.war }}} * 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://:8080/thredds }}} * TDS has is now installed! To configure the catalog.xml file, please refer to [wiki:DataServices/TDS_Config Configuring TDS] or the TDS Admin [http://www.unidata.ucar.edu/projects/THREDDS/tech/tutorial/index.html 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. [wiki:DataServices/tds_with_shib Installing TDS with mod_shib]