Installation

This document describes how to install the Transport Service software contained in the transport-upload package. The following topics can be found in this section:

System Requirements

This section details the system requirements for installing and operating the Transport Service software.

Java Runtime Environment

The Transport Service was developed using Java and will run on any platform with a supported Java Runtime Environment (JRE). The software was specifically compiled for and tested in Java version 1.8. The following commands test the local Java installation in a UNIX-based environment:

% which java
/usr/bin/java

% java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
        

The first command above checks whether the java executable is in the environment's path and the second command reports the version. If Java is not installed or the version is not at least 1.8, Java will need to be downloaded and installed in the current environment. Consult the local system administrator for installation of this software. For the do-it-yourself crowd, the Java software can be downloaded from the Oracle Java Download page. The suggested software package is the Java Standard Edition (SE) 8, either the JDK or the JRE package. The JDK package is not necessary to run the software but could be useful if development and compilation of Java software will also occur in the current environment.

Java Application Server

The Transport Service requires a Java application server for hosting the web application. The suggested application server for this release is Apache Tomcat with a minimal version of 7.0.X. Consult the local system administrator for installation of this software. For the do-it-yourself crowd, see the Tomcat Deployment document for installation and configuration details. If viewing this document from the transport-upload package, view the Tomcat Deployment document from the Engineering Node site.

The top-level directory where Apache Tomcat is installed (i.e. the directory containing the webapps and conf sub-directories) will be referenced in these instructions as $TOMCAT_HOME.

Unpacking the Package

Download the transport-upload package from the PDS FTP site. The binary distribution is available in identical zip or tar/gzip packages. The installation directory may vary from environment to environment but in UNIX-based environments it is typical to install software packages in the /usr/local directory and in Windows-based environments it is typical to install software packages in the C:\Program Files directory. Unpack the selected binary distribution file with one of the following commands:

% unzip transport-upload-0.6.0-bin.zip
or
% tar -xzvf transport-upload-0.6.0-bin.tar.gz
      

Note: Depending on the platform, the native version of tar may produce an error when attempting to unpack the distribution file because many of the file paths are greater than 100 characters. If available, the GNU version of tar will resolve this problem. If that is not available or cannot be installed, the zipped package will work just fine in a UNIX environment.

The commands above result in the creation of the transport-upload-0.6.0 directory with the following directory structure:

  • README.txt

    A README file directing the user to the available documentation for the project.

  • LICENSE.txt

    The copyright notice from the California Institute of Technology detailing the restrictions regarding the use and distribution of this software. Although the license is strictly worded, the software has been classified as Technology and Software Publicly Available (TSPA) and is available for anyone to download and use.

  • transport-upload.war

    This is the Web ARchive (WAR) file containing the Transport Service software including all dependent JAR files.

  • bin/

    This directory contains batch and shell scripts for executing the client application.

  • doc/

    This directory contains a local web site with the Transport Service documentation and other configuration management related information. Just point the desired web browser to the index.html file in this directory.

  • lib/

    This directory contains the dependent jar files for the client application along with the executable jar file (transport-upload-0.6.0.jar) containing the Transport Service software.

Deploying the Web Application

The Transport Service web application is packaged as a WAR file and is intended for installation under a standard Java Application Server. For a Tomcat server deployment, the WAR file is normally copied directly to the webapps directory within the Tomcat installation or installed via the Manager interface. Once this step is complete, the application is ready for operation.

Configuring the Web Application

The Transport Service web application can be configured with a servlet parameter. The application provides the following parameter for configuration:

ParameterDescription
repositoryPathThe path specification for the staging area where the service writes the uploaded files. The default value is /tmp.
emailFlagA flag indicating whether the service will send an email upon a successful file upload. The valid values are True or False with a default value of False.
emailFromThe sender's email address. The default value is pds_operator@jpl.nasa.gov.
emailToThe recipient's email address. The default value is pds_operator@jpl.nasa.gov.
emailSubjectThe subject of the email message. The default value is File Uploaded.

To modify the configuration, edit the web.xml file located in the $TOMCAT_HOME/webapps/transport-upload/WEB-INF directory. The following block contains the parameters:

<servlet>
  <servlet-name>upload</servlet-name>
  <display-name>Upload</display-name>
  <description>
  </description>
  <servlet-class>gov.nasa.pds.transport.UploadServlet</servlet-class>
  <!-- All parameters are optional and default to the values below.
  <init-param>
    <param-name>repositoryPath</param-name>
    <param-value>/tmp</param-value>
  </init-param>
  <init-param>
    <param-name>emailFlag</param-name>
    <param-value>False</param-value>
  </init-param>
  <init-param>
    <param-name>emailFrom</param-name>
    <param-value>pds_operator@jpl.nasa.gov</param-value>
  </init-param>
  <init-param>
    <param-name>emailTo</param-name>
    <param-value>pds_operator@jpl.nasa.gov</param-value>
  </init-param>
  <init-param>
    <param-name>emailSubject</param-name>
    <param-value>File Uploaded</param-value>
  </init-param>
  -->
</servlet>
      

If the parameters above were modified, remember to uncomment the block in order for the changes to take effect.

Configuring the Environment

The steps in this section are only necessary if the user plans to execute the client application in their local environment. In order to execute the client application, the local environment must first be configured appropriately. This section describes how to setup the user environment on UNIX-based and Windows machines.

UNIX-Based Environment

This section details the environment setup for UNIX-based machines. The binary distribution includes a shell script that must be executed from the command-line. Setting the PATH environment variable to the location of the script, enables the shell script to be executed from any location on the local machine.

The following command demonstrates how to set the PATH environment variable (in Bourne shell), by appending to its current setting:

% export PATH=${PATH}:/usr/local/transport-upload-0.6.0/bin
        

In addition, the shell script requires that the JAVA_HOME environment variable be set to the appropriate location of the Java installation on the local machine. The following command demonstrates how to set the JAVA_HOME environment variable:

% export JAVA_HOME=/path/to/java/home
        

The system administrator for the local machine may need to be consulted for this location. The path specified should have a bin sub-directory that contains the java executable. This variable may also be defined within the script. Edit the script (file without the .bat extension) and change the line in the example above to represent the local Java installation.

Windows Environment

This section details the environment setup for Windows machines. The binary distribution includes a batch script that must be executed from the command-line. Setting the PATH environment variable to the location of the file, enables the batch script to be executed from any location on the local machine.

The following command demonstrates how to set the PATH environment variable, by appending to its current setting:

C:\> set PATH = %PATH%;C:\Program Files\transport-upload-0.6.0\bin
        

In addition, the batch script requires that the JAVA_HOME environment variable be set to the appropriate location of the Java installation on the local machine. This may have already been set when Java was installed. However, if it hasn't, then run the following command to set the JAVA_HOME environment variable:

C:\> set JAVA_HOME = C:\path\to\java\home
        

The system administrator for the local machine may need to be consulted for this location. The path specified should have a bin sub-directory that contains the java executable. This variable may also be defined within the script. Edit the script (file with the .bat extension) and change the line in the example above to represent the local Java installation. Additional methods for setting Windows environment variables can be found in the Windows System Properties document.

Installation Location

Both the shell and batch script for this software utilize system commands for determining the installation home directory that may or may not be available on all platforms. If these commands are not available in the current environment, their use can be replaced in the scripts by setting the PARENT_DIR variable with the actual installation path. Modify the UNIX-based shell script as follows (the actual installation path may be different in the current environment):

SCRIPT_DIR=`dirname $0`
PARENT_DIR=`cd ${SCRIPT_DIR}/.. && pwd`

  should be replaced with:

PARENT_DIR=/usr/local/transport-upload-0.6.0
        

Modify the Windows-based batch script as follows (the actual installation path may be different in the current environment):

set SCRIPT_DIR=%~dps0
set PARENT_DIR=%SCRIPT_DIR%..

  should be replaced with:

set PARENT_DIR=C:\Program Files\transport-upload-0.6.0