Step 1 – Install JRE and SDK
Check the version of Java by typing:
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:
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:
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:
Add the following lines to the file:
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:
If everything is working fine, you will see the following lines:
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:
[Adapted from http://doc.gwos.org/index.php/Install_tomcat_5.5]
[27-07-2007: Also see http://www.bartbusschots.ie/blog/?p=240]