Tuesday, November 6, 2012

apache-tomcat configuration on linux

Simple steps to configure apache-tomcat server

  1. Download apache-tomcat binary tarball from http://tomcat.apache.org/
  2. Copy the tarball to a specified location where you want to keep these tomcat installable. In my case   /opt or /usr/rakesh
  3. Untar the tarball and rename it as apache-tomcat 
# tar -xvzf apache-tomcat-7.0.32.tar.gz
# mv apache-tomcat-7.0.32 apache-tomcat
  1. Open server.xml
# vim apache-tomcat/conf/server.xml
edit line   
# if you wish to keep default port then keep the same else change it to any like
  1. Open startup.sh and add JRE_HOME path
# vim apache-tomcat/bin/startup.sh
add following line (set JRE_HOME/JAVA_HOME paths) :
export JRE_HOME=
  1. Execute startup.sh to start tomcat server
apache-tomcat/bin/startup.sh
This command will produce following output
 Using CATALINA_BASE:   /opt/apache-tomcat
 Using CATALINA_HOME:   /opt/apache-tomcat
 Using CATALINA_TMPDIR: /opt/apache-tomcat/temp
 Using JRE_HOME:        /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
 Using CLASSPATH:       /opt/apache-tomcat/bin/bootstrap.jar:/opt/apache-tomcat/bin/tomcat-juli.jar   
  1. Open a web browser and type your host's fully qualified domain name and a port number:
OR
http://localhost:8880
This will open the tomcat welcome page.