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.
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 😀
<title>JSP Test page.</title>
<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>
To shut-down the Tomcat server use this command(run shutdown.sh shell script) : ./shutdown.sh