Wednesday, December 5, 2012

Install tomcat on ubuntu



Installing Tomcat on Ubuntu:
  1. Download Tomcat 7 tar.gz binary distribution from here.
  2. Unpack it using following command.
    1. tar xvzf apache-tomcat-7.0.29.tar.gz   
  3. Move it to a more appropriate location using following command
    1. sudo mv apache-tomcat-7.0.29/ /usr/share/tomcat7  
  4. Open up /usr/share/tomcat7/bin/catalina.sh file using following command
    1. gedit /usr/share/tomcat7/bin/catalina.sh   
  5. Add following two lines in there after the first line
    1. JAVA_HOME="/usr/lib/jvm/jdk-6u32"  
    2. JRE_HOME="/usr/lib/jvm/jdk-6u32/jre"  
  6. Open up /usr/share/tomcat7/conf/tomcat-users.xml and uncomment user and role entries there. Then add a manager-gui role and a user by adding following lines there
    1. <role rolename="manager-gui"/>  
    2. <user username="UserName" password="tomcat" roles="manager-gui"/>  
  7. Start the Tomcat server using following command
    1. sudo /usr/share/tomcat7/bin/catalina.sh run  
  8. Verify Tomcat installation using the following URL.
    1. http://127.0.0.1:8080/  
  9. To login as the manager, use the following URL, provide the relevant username and password.
    1. http://127.0.0.1:8080/manager/html