first_page

Installing Tomcat

This is the command summary for installing Tomcat on Ubuntu Linux:sudo apt-get install sun-java5-jdk

sudo apt-get install apache2 sudo apt-get install tomcat5 sudo apt-get install tomcat5-admin Point Ubuntu to the newly installed Java JDK with:sudo update-alternatives --config java Select /usr/lib/jvm/java-1.5.0-sun/jre/bin/java.

Configure Tomcat for the Java JDK. Edit /etc/default/tomcat5 for this line:JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/ Review the users for Tomcat in /var/lib/tomcat5/conf/tomcat-users.xml. Here is one relatively terrible way to configure the default user, tomcat:<user username="tomcat" password="foo" roles="tomcat,manager,admin" /> Start Tomcat with:sudo /etc/init.d/tomcat5 start Test for connectivity by browsing http://localhost:8180. You can change this port number by editing the standalone server service, Tomcat-Standalone, in /usr/share/tomcat5/conf/server.xml.

Much of this summary is based on “Setting Up Tomcat 5 on Ubuntu 6.06” here:

http://blixtra.org/blog/2006/07/14/setting-up-tomcat-5-on-ubuntu-606/

and “Installing Java 5 JDK and Tomcat on Ubuntu (using VMWare)” here:

http://www.spaceprogram.com/knowledge/2006/05/installing-java-5-jdk-and-tomcat-on.html

Comments

blackrayne, 2006-10-20 00:21:22

thank you thank you thank you lol this little tut was just what i need thanks again

rasx(), 2006-10-20 18:44:20

much appreciation for the appreciation...

Ramon, 2006-11-08 16:17:49

GREAT WALK THROUGH!. This is exactly what I needed and I am very happy to get it from you. Worked flawlessly, and only took about 5 mins!

rasx(), 2006-11-08 18:27:16

yes!

Jim Pinkham, 2006-12-08 15:31:38

Great guide - this helped me a lot.

It was not obvious to me that when changing sources.list to add multiverse, it is necessary to run sudo apt-get update first, before sudo apt-get update sun-java5-jdk otherwise, you get E: Couldn't find package sun-java5-jdk

Daeval, 2007-06-28 03:31:42

This is approaching a year old now, but is still the best, most concise, and most functional tutorial I could find. It has the added bonus of avoiding the manual editing of .bashrc. Only minimal tweaks were necessary for Tomcat 5.5, Java6, and Ubuntu 7.04 Feisty. On the off chance you still read comments for this, Thanks!

rasx(), 2007-06-28 18:21:23

Daeval: I appreciate the appreciation!

Sean, 2007-12-25 17:16:41

It seems a bit curiosu to me that you install apache2 before tomcat. Correct me if im wrong, but Tomcat should be able to stand on its own 2 feet without installing apache, no?

rasx(), 2007-12-26 19:32:37

Check out “Tomcat---A Minimalistic User's Guide”: "Tomcat can be used as either a stand-alone container (mainly for development and debugging) or as an add-on to an existing web server (currently Apache, IIS and Netscape servers are supported)."

Some server admins would prefer to open as few ports as possible---like port 80 running apache and then plugin other application servers (like Tomcat) into apache.

Linita, 2008-01-19 20:57:19

Hi! I have a problem.. I've installed and configured tomcat5.5 step by step, but I had two web app that I did on windows and there all works.. but when I copy it on my linux it doesnt works!!..

thanx for your help

rasx()