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 :D
<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

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 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 :D

<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
thanx gihan.......
ReplyDeleteWonderful 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.
ReplyDeleteheya, 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
ReplyDeletehi, 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
ReplyDeleteNo Jennifer, it's not a custom build theme. It is Freshy theme for wordpress blogs. :D http://theme.wordpress.com/themes/freshy/
ReplyDelete:D No problem Amee.
ReplyDeleteI like Your Article about How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.. Perfect just what I was looking for! .
ReplyDeleteThanks 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!
ReplyDeleteThanks i love your article about How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog..
ReplyDeleteYour 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.
ReplyDeleteI agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., good post.
ReplyDeleteI agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., excellent post.
ReplyDeleteI agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., good post.
ReplyDeleteThanks i love your article about How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog..
ReplyDeleteExcellent 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.
ReplyDeleteI don't know what to say to be good. Everyone can to have an oppinion, i say just our oppinion is not the same.
ReplyDeleteI agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., superb post.
ReplyDeleteI agree with your How to install Apache Tomcat server on Ubuntu 11.04 Gihan's Blog.., wonderful post.
ReplyDeletethanx a lot for this simple article on tomcat, please keep publishing such articles, they are great.
ReplyDeleteYour 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.
ReplyDeleteStudying 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.
ReplyDeletecould not start tomcat....shows permission denied
ReplyDeleteOk pls try this command chmod 755 startup.sh before ./startup.sh I think it should fix your problem! :D
ReplyDeletei tried the command...but it is showing..this error...
ReplyDelete"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."..
That means first you need to set your JAVA_HOME variables. So try this on terminal window
ReplyDeletesudo /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