CSCI 405 Server Programming - Lab Setup

Overview

This web page provides instructions on how to setup your environment in the computer science labs to run the Tomcat web server. For the Windows environment on your personal computer, setup instructions are provided in the course text.

Install Tomcat

Download the most recent binary release of tomcat from the Tomcat web site. The file you want should end with .tar.gz. Use the following command to expand the downloaded archive.

tar -zxvf filename.tar.gz

Let ${TOMCAT_HOME} represent the path to the folder into which you expanded the download.

Create the following two scripts, which you will use to start and stop tomcat. In the following, replace ${TOMCAT_HOME} with the path to the folder that contains tomcat.

start_tomcat.sh

#!/bin/sh
export CATALINA_HOME=${TOMCAT_HOME}
export JAVA_HOME=/usr/java/jdk1.6.0_07
$CATALINA_HOME/bin/startup.sh

stop_tomcat.sh

#!/bin/sh
export CATALINA_HOME=${TOMCAT_HOME}
export JAVA_HOME=/usr/java/jdk1.6.0_07
$CATALINA_HOME/bin/shutdown.sh

Set the execute bit on the two scripts you just created.

chmod +x start_tomcat.sh
chmod +x stop_tomcat.sh

Start tomcat with the following.

./start_tomcat.sh

Stop tomcat with the following.

./stop_tomcat.sh