How to install Apache Tomcat server on Ubuntu 11.04

Hi, Today I’m going to tell you how to install Apache tomcat server on your Ubuntu (Linux) computer. You can install and use it as a portable installation on your pen drive too.Apache tomcat server is used to run .jsp file (Java Server Pages). So first you need to download Apache Tomcat 7.0 from Apache site.

DOWNLOAD Apache tomcat here!..

Ok let’s do it. Now extract the downloaded apache-tomcat-7.0.19.tar.gz file into desktop or to your pen drive.

Then rename it as tomcat (only for our convenience)

Open Terminal window (Ctrl+Alt+T)

Then go to this folder using this command : cd Desktop/tomcat/bin ( assuming you extracted on your Desktop )

Then run this command(run startup.sh shell script) : ./startup.sh

Now open firefox go to this URL : http://localhost:8080/ . Then you should see it like this!

Now try a jsp script to test the installation.

If you want to, copy this code and save it into tomcat–>webapps–>ROOT as hello.jsp  Then run it http://localhost:8080/hello.jsp  😀

<html>
<head>
<title>JSP Test page.</title>
</head>
<body>
<p align=”center”><font color=”#009900″ size=”7″><%=”gihansblog.com”%></font></p>
<p align=”center”><font color=”#FF0000″ size=”6″><%=”Hello JSP World!”%> </font></p>
<p><%= new java.util.Date()%></p>
</body>
</html>

To shut-down the Tomcat server use this command(run shutdown.sh shell script) : ./shutdown.sh

Thanks

Gihan

25 Comments

  1. Reply
    තාරා July 29, 2011

    thanx gihan…….

  2. Reply
    Amee Brooksher August 2, 2011

    Wonderful document along with very easy for you to figure out justification. Exactly how can My spouse and i attempt receiving concur for you to submit element in the document inside my future news letter? Getting suitable credit history to you personally your publisher along with web page link on the blog won’t certainly be a trouble.

    • Reply
      Gihan August 2, 2011

      😀 No problem Amee.

  3. Reply
    taylor lautner workout August 2, 2011

    heya, one quick question for you, is the theme your using custom built? The reason I ask I’m looking for something similar but I cant find one, can you please tell me where you got it from? many thanks, Jennifer

  4. Reply
    this here August 2, 2011

    hi, quick question, is your theme custom built? I’m just wondering because I’m looking for something similar but im struggling, can you please tell me where you got it from? Thanks a lot, Jennifer

  5. Reply
    vpn download August 3, 2011

    I like Your Article about How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.. Perfect just what I was looking for! .

  6. Reply
    black peep toe pumps August 4, 2011

    Thanks for informative post. I am pleased sure this post has helped me save many hours of browsing other similar posts just to find what I was looking for. Just I want to say: Thank you!

  7. Reply
    vnc download August 4, 2011

    Thanks i love your article about How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog..

  8. Reply
    cover letter August 6, 2011

    Your Article about How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.. Real wonderful visual appeal on this web site , I’d rate it 10 10.

  9. Reply
    zombieville usa August 7, 2011

    I agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., good post.

  10. Reply
    invest liberty reserve August 7, 2011

    I agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., excellent post.

  11. Reply
    invest liberty reserve August 7, 2011

    I agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., good post.

  12. Reply
    invest liberty reserve August 9, 2011

    Thanks i love your article about How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog..

  13. Reply
    Patrick Finner August 9, 2011

    Excellent piece of writing and easy to realize story. How do I go about getting agreement to post element of the content in my upcoming newsletter? Offering proper credit to you the source and weblink to the site will not be a problem.

  14. Reply
    tv online August 12, 2011

    I don’t know what to say to be good. Everyone can to have an oppinion, i say just our oppinion is not the same.

  15. Reply
    beautiful widgets apk August 13, 2011

    I agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., superb post.

  16. Reply
    beautiful widgets apk August 18, 2011

    I agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., wonderful post.

  17. Reply
    shashank August 24, 2011

    thanx a lot for this simple article on tomcat, please keep publishing such articles, they are great.

  18. Reply
    cover letter August 29, 2011

    Your Article about How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.. Real wonderful visual appeal on this internet site , I’d rate it 10 10.

  19. Reply
    mobile computer repairs August 31, 2011

    Studying from earlier problems might be one of the better guidelines for bloggers who normally omit writing a blog if achievement just isn’t featuring up promptly. On the other hand search engines like google prizes endurance and just by possessing persistence and by incorporating far more associated subject material to a website, you can currently pass many webmasters within your area of interest who do not have persistence.

  20. Reply
    leoanto November 14, 2011

    could not start tomcat….shows permission denied

    • Reply
      Gihan November 15, 2011

      Ok pls try this command chmod 755 startup.sh before ./startup.sh I think it should fix your problem! 😀

  21. Reply
    leoanto November 17, 2011

    i tried the command…but it is showing..this error…
    “Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
    At least one of these environment variable is needed to run this program.”..

    • Reply
      Gihan November 17, 2011

      That means first you need to set your JAVA_HOME variables. So try this on terminal window

      sudo /etc/bash.bashrc

      JAVA_HOME=/usr/lib/jvm/java (I assume this should be your java directory)
      export JAVA_HOME
      PATH=$PATH:$JAVA_HOME/bin
      export PATH

      source /etc/bash.bashrc
      source ~/.bashrc

      echo $JAVA_HOME (this will show you the path you set up)
      echo $PATH

Leave a Reply