Install and Configure Tomcat on Ubuntu

To install and configure Tomcat on Ubuntu Feisty or Hardy can be easily done.

1. Download and install the Java packages need for Tomcat to work (run in terminal):

sudo apt-get install sun-java6-bin sun-java6-jdk sun-java6-jre

2. Download and install the Tomcat packages (run in terminal):

sudo apt-get install libapache2-mod-jk libservlet2.4-java libtomcat5.5-java tomcat5.5 tomcat5.5-admin tomcat5.5-webapps

3. Open the .bashrc file (run in terminal):

sudo gedit ~/.bashrc

4. Add the following line in the opened file:

export JAVA_HOME=/usr/lib/jvm/java-6-sun

save and close the file

5. make the logs directory writable (run in terminal):

sudo chmod -R 777 /var/lib/tomcat5.5/logs

6. if your terminal is opened, close it and open up again

7. to start the tomcat, run the following command:

sh /usr/share/tomcat5.5/bin/startup.sh

8. now you can test to see if it’s working, point your browser at:

http://localhost:8180/

you should be able to see the tomcat splash page :)

9. to shutdown tomcat, use the following command:

sh /usr/share/tomcat5.5/bin/shutdown.sh

Be Sociable, Share!

About Shi Chuan

I am a web developer.
This entry was posted in JSP Core and tagged . Bookmark the permalink.

9 Responses to Install and Configure Tomcat on Ubuntu

  1. rcsprakash says:

    after reading through so many forum help posts, i think your way is so far the only working one. thank you.

  2. zeriano says:

    nice and comprehensive, good work!

  3. Jay Cubes says:

    Thank you! I got the “Successful!” page! Many thanks! :D

  4. venu says:

    thanks …… it works

  5. Mahesh says:

    Thanks It works but asking user and password. i entered user:”admin” and “tomcat” and password :”admin” bt it showing “Invalid username or password
    To try again”

  6. Mahesh says:

    Thanks It works but asking user and password. i entered user:”admin” and “tomcat” and password :”tomcat” bt it showing “Invalid username or password
    To try again”

  7. zebrrra says:

    NOTE: point 8: the default port might be different (8080 in my case)

  8. This post seems still to be very popular. Maybe people who read this, like also know about installing tomcat 7.
    A good description of it can be found here: http://wiki.v-collaborate.com/display/BLOG/2010/12/08/Install+Apache+Tomcat+7+on+ubuntu+and+debian

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>