Apache Tomcat is an open source web server and servlet container created by the Apache Software Foundation. It’s used to execute to Java servlets and also render web pages that include JSP (Java Server Page) code. Here we walks through the process of installing Tomcat manually on a Centos.
Download apache-tomcat file

==

http://apache.mirrors.tds.net/tomcat/tomcat-7/v7.0.52/bin/apache-tomcat-7.0.52.zip

===
Also download jdk from oracle.com
==
need to create a login, it is free in oracle, it is called java se development kit.
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html >> choose required version one.
jdk-7u51-linux-i586.tar.gz
we download this or we can download rpm, if we want multipe version jdk we download tar.gz.
jdk-7u51-linux-i586.rpm
install with rpm command >>rpm -ivh jdk-7u51-linux-i586.rpm
====
[root@server1 ~]# rpm -ivh jdk-7u51-linux-i586.rpm
Preparing… ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files…
rt.jar…
jsse.jar…
charsets.jar…
tools.jar…
localedata.jar…
jfxrt.jar…
plugin.jar…
javaws.jar…
deploy.jar…
====
[root@server1 java]# java -version
java version “1.7.0_51″
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
===
there is 2 way apache and tomcat is interlinked
mod_jk and mod_proxy_ajp
===
if using apache it will be in /home/httpd/friendishan.asia/conf/
==
[root@server1 friendishan]# pwd
/home/friendishan
==
[root@server1 friendishan]# ll
total 8700
-rw-r–r– 1 root root 8886342 Mar 17 23:31 apache-tomcat-7.0.52.zip
-rw-r–r– 1 friendishan friendishan 7257 Mar 15 19:33 friendasia.jsp
drwxr-xr-x 9 friendishan friendishan 4096 Mar 13 19:46 friendishan.asia
drwxr-xr-x 2 friendishan apache 4096 May 29 2013 kloxoscript
drwxr-xr-x 2 root root 4096 May 26 2013 __processed_stats
lrwxrwxrwx 1 root root 35 Feb 4 17:54 public_html -> /home/friendishan/friendishan.asia/
==
copied that file to home of friendishan.asia/
unzip
set ownership
inside apaache-tomcat there is conf/server.xml we set port.
by default <Connector port=”8080″ protocol=”HTTP/1.1″
connectionTimeout=”20000″
redirectPort=”8443″ />
====
you cant tomcat use port 8080 for webaccess you will see another port.
<Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ />
this is what we gonna use to link to apache
what we do is add ProxyPass /myApp ajp://127.0.0.1:8009/MyApp
===
ProxyPass /myApp ajp://127.0.0.1:8009/MyApp
Add this line in virtualhost entry.
in this case we use: ProxyPass /dtesir ajp://127.0.0.1:8009/dtesir
after that we restart apache and also tomcat
apache with httpd restart
and tomcat with tomcat script
/home/friendishan/apache-tomcat-7.0.52
./bin/shutdown.sh for shutdwon and ./bin/startup.shfor start
we usually run shutdown command 2 or 3 times
otherwise wont shutdown properly
===

Please try this…………..:)apache_logo

Leave a Reply

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