Pages

Monday, March 24, 2014

Install tomcat 7 manually in ubuntu and integrate with eclipse

  1. Download Tomcat 7 tar.gz
  2. Run the following commands
  3. 
    cd /path/to/downloaded/file
    tar xvzf apache-tomcat-7.0.52.tar.gz
    sudo mv apache-tomcat-7.0.52/ /usr/share/tomcat7
    sudo gedit /usr/share/tomcat7/bin/catalina.sh
    
  4. Add following two lines after the first line and close gedit after saving the changes
  5. 
    JAVA_HOME="/usr/lib/jvm/java-6-openjdk-i386"
    JRE_HOME="/usr/lib/jvm/java-6-openjdk-i386/jre"
    
  6. To integrate with eclipse
  7. 
    cd /usr/share/tomcat7
    sudo ln -s /var/lib/tomcat7/conf conf
    sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
    sudo ln -s /var/log/tomcat7 log
    sudo chmod -R 777 /usr/share/tomcat7/conf
    
  8. Start the Tomcat server using following command to check if it is working
  9. 
    sudo /usr/share/tomcat7/bin/catalina.sh run
    
  10. Stop the server by pressing ctrl+c
  11. To change the port number, open server.xml in gedit
  12. 
    sudo gedit /usr/share/tomcat7/conf/server.xml
    
  13. Change all the occurrences of <connector port="8080"> to <connector port="8081">
  14. Verify installation at: http://localhost:8081/

No comments: