Wednesday 12 December 2012

Install Tomcat on a Linux Server

This article walks you through installing Tomcat on your Linux server. This has been tested on a Linux server with Cent OS release 5.5 (Final) and no control panel (e.g., Plesk or cPanel).  These instructions were performed with Tomcat 7.0.10. This only applies to Cloud and Dedicated accounts.  You can view more information about these account types at http://www.hosting.com/services/platform-services.

  1. Obtain a tarball (.tar.gz) of the latest stable release of Tomcat from http://tomcat.apache.org/ and place it in /usr/local/ on your Linux server. For example, you might run something like this at command prompt on your Linux server.

            wget http://www.bizdirusa.com/mirrors/apache/tomcat/tomcat-7/v7.0.10/bin/apache-tomcat-7.0.10.tar.gz

  2. Extract the tarball by running a command similar to the following:

             tar -xvzf apache-tomcat-x.x.x.tar.gz (x.x.x is the version of Tomcat you obtained in step 1 above)

  3. Create a symbolic link.  The LINK NAME will be Tomcat and the TARGET will be the path of the extracted folder you created in step 2. It may look something like this:

             ln -s /usr/local/apache-tomcat-7.0.10 ./tomcat

  4. Run the following command:

            export CATALINA_HOME=/usr/local/tomcat

  5. Add the following lines to your /etc/profile file. It will set the CATALINA_HOME variable automatically if the system restarts.

    profile

  6. Install the latest stable release of the Java JDK. You can obtain this at http://www.oracle.com/technetwork/java/javase/downloads/index.html.This should be placed into /usr/java/jdkx.x.x_xx (the x's will be your version number).

  7. Run the following command:

            export JAVA_HOME=/usr/java/jdk1.6.0_23 (The 1.6.0_23 you should replace with your version of the JDK you installed in Step 6.

  8. Add the following lines to your /etc/profile file. It will set the JAVA_HOME variable automatically if the system restarts. Replace the 1.6.0_02 with your version.

    profile2

  9. Run the following command to start the Tomcat server:
    $CATALINA_HOME/bin/startup.sh

  10. If you obtained any errors on the starting of Tomcat, please review the _ log to resolve those issues. Once those issues are resolved, proceed to step 11.

  11. Verify that the Tomcat server is running by browsing to http://Your_IP_Here:8080/





No comments:

Post a Comment

Thanks for Visiting LinuxWorkstation