Wednesday, February 23, 2011

How Install Tomcat

For stand alone installation:

  •  Stop apache if it is running:

#  service   httpd  status
#  service   httpd  stop
#  chkconfig  --list  httpd
#  chkconfig  httpd  off

  •  Install JDK

Check java version using:
#  java   -version
#  echo JAVA_HOME    //if none, set JAVA_HOME
#  export   JAVA_HOME=/usr/java/jdk1.6-23   //add it to your profile.

      # yum   list   gcc     //  if it is not installed then,  yum   install   gcc

            #  cd   Softwares
#  tar  xzf  apache-tomcat-7.0.6.tar.gz
#  mv apache-tomcat-7.0.6    /opt/tomcat

  •  Test it
#  /opt/tomcat/bin/startup.sh

            Add CATALINE_HOME to your profile
#  cd
#  vi  .bash_profile
export   CATALINA_HOME=/opt/tomcat

# export   CATALINA_HOME=/opt/tomcat
# groupadd   tomcat
#  useradd  -g  tomcat  -d  /opt/tomcat   tomcat
#  passwd  tomcat                 
#  chown  -R  tomcat:tomcat   /opt/tomcat
#  cd   /opt/tomcat/bin
#  tar   xzf   common-daemon-native.tar.gz
#  cd   common-daemon-1.0.5-native-src/unix
#  ./configure
#  make
#  cp  jsvc   ../..
#  cd   ../../..
#  cp   /opt/tomcat/bin/common-daemon-1.0.5-native-src/unix/samples/Tomcat7.sh   /etc/init.d/tomcat

  • To start tomcat:

      #  /etc/init.d/tomcat start

  • To stop tomcat:

      #  /etc/init.d/tomcat stop

  • Change Apache Tomcat port 8080 to 80 or another port number

#  vi    /opt/tomcat/conf/server.xml
<Connector port="80" … />
# /etc/init.d/tomcat  restart

Done 
Inas

No comments:

Post a Comment