Install Tomcat in Ubuntu is very easy. We can either install manually or with help of apt-get install.

Apt-get Install

1) Find a correct tomcat package to install

sudo apt-cache search tomcat

2) Install all Tomcat package with following command

sudo apt-get install tomcat5.5-webapps
sudo apt-get install tomcat5.5-admin
sudo apt-get install tomcat5.5

3) Done

apt-get help Ubuntu to configure almost everything and create a script put inside init.d folder for Tomcat auto startup script. we can 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

apt-get help to create a share folder in /usr/share also, please access

cd /usr/share/tomcat5.5

and issue a ls -lh in /usr/share/tomcat5.5 to find out the rest of the Tomcat location.

drwxr-xr-x bin
drwxr-xr-x common
lrwxrwxrwx conf -> /etc/tomcat5.5
lrwxrwxrwx doc -> ../doc/tomcat5.5
lrwxrwxrwx logs -> /var/lib/tomcat5.5/logs
drwxr-xr-x server
lrwxrwxrwx shared -> /var/lib/tomcat5.5/shared
lrwxrwxrwx temp -> /var/lib/tomcat5.5/temp
lrwxrwxrwx webapps -> /var/lib/tomcat5.5/webapps
lrwxrwxrwx work -> /var/lib/tomcat5.5/work

Manually Install

This is even more easy that apt-get

1) Visit http://tomcat.apache.org/ to download Tomcat

2) Unzip it with tar -zxvf Tomcatxxx.tar

tar -zxvf apache-tomcat-6.0.16.tar.gz

3) No make or configuration required, just change to tomcat bin folder to start or stop Tomcat

:~/Desktop/apache-tomcat-6.0.16/bin$ sh startup.sh
:~/Desktop/apache-tomcat-6.0.16/bin$ sh shutdown.sh

4) Done

Personally i more prefer to install application manually, because it give full control of where application folder should be store.

Tags :
Founder of Mkyong.com, love Java and open source stuffs. Follow him on Twitter, or befriend him on Facebook or Google Plus.
Here are some of my recommended Books

Related Posts

Popular Posts