Tomcat 6 + Eclipse 3.5 on Ubuntu 9.10

There are 2 ways to install Tomcat on Ubuntu: automatically from repository and manually from Apache.

1.Install from repository (tomcat6-admin and tomcat6-webapps are optional)

sudo get-apt install tomcat6 tomcat6-admin tomcat6-webapps

then start/stop/restart tomcat with following command

/etc/init.d/tomcat5.5 start
/etc/init.d/tomcat5.5 stop
/etc/init.d/tomcat5.5 restart

The problem is that you cannot configure Eclipse to work with it because conf and lib are under different directories. So for development machines, you might want to install it manually. In case you have installed it from repository, you can remove it with

sudo apt-get –purge remove tomcat6 tomcat6-admin tomcat6-webapps

2.Install Manually
download tomcat from Apache

tar -zxvf apache-tomcat-x.x.xx.tar.gz
sudo mv apache-tomcat-x.x.xx /opt/
ln -s apache-tomcat-x.x.xx tomcat
sudoedit ~/.bashrc

add this line

export CATALINA_HOME=/opt/tomcat

start/stop tomcat with

$CATALINA_HOME/bin/startup.sh
$CATALINA_HOME/bin/shutdown.sh

To use tomcat manager, you have to configure users.

sudoedit /opt/tomcat/conf/tomcat-users.xml

add

<user name=”admin” password=”admin” roles=”manager,admin” />

right before </tomcat-users>

Integrate Tomcat into Eclipse
Window->Preferences->
Server->Runtime Environments->Add->
Apache Tomcat V6.0->Next->
Browse->/opt/apache-tomcat-x.x.xx->OK
Finish->OK

3 thoughts on “Tomcat 6 + Eclipse 3.5 on Ubuntu 9.10”

  1. Hey, you have made a typo at:
    1.Install from repository (tomcat6-admin and tomcat6-webapps are optional)

    sudo get-apt install tomcat6 tomcat6-admin tomcat6-webapps

    Which is apt-get. 🙂

  2. Hi, here i have some doubt, i install eclipse using synaptic package manager. Now i want to configure tomcat in eclipse. I haven’t the option server here windows->preference->
    Plz help me, Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image