Blogger templates

Monday, 8 April 2013

How To Install Apache Tomcat on Linux(Redhat/Ubuntu)?

How To Install Apache Tomcat on Linux(Redhat/Ubuntu)?

How to install Apache tomcat on Linux(Redhat/Ubuntu)?


What is Apache tomcat?

Ans : ApacheTomcat is an open source web application server which supports J2ee Servlets, JavaServer, Pages(JSP) and API’s. Tomcat should not be confused with Apache web server which an HTTP web server.
—Wikipedia.

Some terminology about Apache tomcat.
Apache Tomcat can be configured by editing server.xml file. Those who knows apache web server. This server.xml can be taken as synonimas to httpd.conf file.
Servlet is defined as a way add dynamic content to a Web server using the Java platform. And a servlet container is a compiled, executable program. The servlet container name is tomcat is catalina.

Pre requists for Apache tomcat are
1. java
2. JDK
Step by step for installing Apache tomcat
Note : Avoide installing tomcat from reposatories, always prefer to install it from source downloaded from apache site.
Step1 : Install all the prequistes
Redhat :
#yum install java
Ubuntu :
#apt-get install java

Step2 : Download tomcat source package and uncompress it.
Redhat/Ubuntu
#cd /opt
#wget http://www.trieuvan.com/apache/tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz
#tar xvfz apache-tomcat-6.0.29.tar.gz

Step3 : Setup the paths for Catalina and others.
Setting catalina paths
Redhat/ubuntu

CATALINA_HOME=/opt/apache-tomcat-6.0.29
CATALINA_BASE=/opt/apache-tomcat-6.0.29
Setting java paths
Check what java versions are installed in your system

#update-alternatives –config java
This command will display which is default java version used by your machine.
Example output :
# update-alternatives –config java
There are 2 programs which provide ‘java’.

Selection Command
———————————————–
1
/usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2
/usr/lib/jvm/jre-1.6.0-openjdk/bin/java
Enter to keep the current selection[+], or type selection number:
If you see above the default java version is 1.6 so set the path to /usr/lib/jvm/jre-1.6.0-openjdk

JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk
JDK_HOMe=$JAVA_HOME
Step4 : Now start tomcat server
#/opt/apache-tomcat-6.0.29/bin/sartup.sh
Sample output.

Using CATALINA_BASE: /opt/apache-tomcat-5.5.26
Using CATALINA_HOME: /opt/apache-tomcat-5.5.26
Using CATALINA_TMPDIR: /opt/apache-tomcat-5.5.26/temp
Using JRE_HOME:
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/
Step5 : By default Apache Tomcat will be hosted onlocalhost : 8080 port by default. So try to access the site with web browser

http://localhost:8080
or
http://localhost:8080
or
http://systemname:8080
Stay tuned to other posts about troubleshooting tomcat installation.

No comments:

Post a Comment

 

Blogroll

Hello Friends myself Sahaj Ohri live at Jaipur city , This Website is mainly for Youth, You can explore a youth network here on www.techowner.blogspot.in As it is generally an information sharing platform when you can get information and also share information. If you are having some information.I am 19 years old guy from India who have interest in making blogs.I am a simple guy who likes to spent his time with Friends,watching movies,and reading various types of books. I loves to sharemy personal view with those people who have interest inmaking website, blog etc.Here I also give you some technical knowledge about making website attractive and some other technical support(knowledge) using WordPress as your CMS.Dear Friends, As an author, I’m trying my best to improve this platform day by day. If you are having any idea or suggestion in your mind about this website then you are free to contact me and share your thought. Contact : For Issues regarding advertisement, copyright issues or ideas sharing, you can contact us on the following details. sahaj.ohri3@gmail.com

About

Hello Friends myself Sahaj Ohri live at Jaipur city , This Website is mainly for Youth, You can explore a youth network here on www.techowner.blogspot.in As it is generally an information sharing platform when you can get information and also share information. If you are having some information.I am 19 years old guy from India who have interest in making blogs.I am a simple guy who likes to spent his time with Friends,watching movies,and reading various types of books. I loves to sharemy personal view with those people who have interest inmaking website, blog etc.Here I also give you some technical knowledge about making website attractive and some other technical support(knowledge) using WordPress as your CMS.Dear Friends, As an author, I’m trying my best to improve this platform day by day. If you are having any idea or suggestion in your mind about this website then you are free to contact me and share your thought. Contact : For Issues regarding advertisement, copyright issues or ideas sharing, you can contact us on the following details. sahaj.ohri3@gmail.com