Apache Tomcat 5.5 on Ubuntu Edgy Eft 6.10

Step 1 – Install JRE and SDK

Check the version of Java by typing:

java -version

Use these instructions to install if necessary.

Step 2 – Get Tomcat

Download Tomcat 5.5 from http://tomcat.apache.org/. In this example I am using apache-tomcat-5.5.23.tar.gz

Move to file to /usr/share and decompress:

tar zxf apache-tomcat-5.5.23.tar.gz

Step 3 – Add a Symbolic Link

To make things simpler I added the symbolic link ‘tomcat’ which points to the apache-tomcat-5.5.23 directory. Within /usr/share type:

ln -s ./apache-tomcat-5.5.23 ./tomcat

Step 4 – Set JAVA_HOME and CLASSPATH

You need to point out where you installed Java SDK. You will have to edit the file ‘.bashrc’. (I suggest you backup first just in case.) In terminal type:

sudo nano ~/.bashrc

Add the following lines to the file:

# for tomcat
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/
export CLASSPATH=”/usr/share/tomcat/common/lib/jsp-api.jar;/usr/share/tomcat/common/lib/servlet-api.jar”

Save and close. You will have to log out and back in again before these changes take effect.

Step 5 – Starting and stopping tomcat

Tomcat should now be ready to run. In terminal type:

sudo /usr/share/tomcat/bin/startup.sh

If everything is working fine, you will see the following lines:

Using CATALINA_BASE: /usr/share/tomcat
Using CATALINA_HOME: /usr/share/tomcat
Using CATALINA_TMPDIR: /usr/share/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/

In your browser head to http://localhost:8080/ and test.

To stop Tomcat type:

sudo /usr/share/tomcat/bin/shutdown.sh

[Adapted from http://doc.gwos.org/index.php/Install_tomcat_5.5]

[27-07-2007: Also see http://www.bartbusschots.ie/blog/?p=240]

Leave a Reply