Tuesday, October 23, 2012

Installing tomcat 7 on Ubuntu Server 12.04 (Precise Pangolin)


The easiest way to install tomcat7 on ubuntu Server 12.04 or Precise Pangolin is to use apt-get. 

Here is the command: 


sudo apt-get install tomcat7


If you already had tomcat6 earlier on this machine there might be issues with tomcat6-commons when running this. Make sure you remove tomcat6-common before running the above command. 


sudo apt-get remove tomcat6-common


Manual Install: 

1. Make sure you have JRE Installed on your machine. 

2.  Download Tomcat 7 tar.gz binary distribution

3.  Unpack it using tar xvzf apache-tomcat-7.0.29.tar.gz

4. Create a directory where you want to install it and them move the unpacked stuff there. For e.g., I've created a directory named /usr/share/tomcat7. Use below command to move it: 

sudo mv apache-tomcat-7.0.29/ /usr/share/tomcat7


5. Edit catalina.sh and add following lines: 

JAVA_HOME="/usr/lib/jvm/jdk-6u32"
JRE_HOME="/usr/lib/jvm/jdk-6u32/jre" 


6.  Start tomcat using below command 

sudo /usr/share/tomcat7/bin/catalina.sh run


That's It... Simply Isn't It?

No comments:

Post a Comment