1. Get Java Development kit. Depends the version you downloaded, the latest version I got as updated 27th Sept 2007 is jdk-1_5_0_12-linux-i586-rpm.bin.
  2. make the file executable, then install it:
    chmod 777 jdk-1_5_0_12-linux-i586.bin
    ./jdk-1_5_12-linux-i586.bin
  3. after install, go into the installed java folder :
  4. cd /usr/java/jdk1.5.0_12

  5. download the apache-tomcat (Please refer to the latest version of apache-tomcat website)
  6. wget http://download.nextag.com/apache/tomcat/tomcat-5/v5.5.25/bin/apache-tomcat-5.5.25.zip
    unzip apache-tomcat-5.5.25.zip

  7. go into theapache-tomcat installed folder, edit some of the files:
  8. cd bin
    vi catalina.sh

    add
    JAVA_HOME=/usr/java/jdk1.5.0_12
    JAVA_OPTS=-Xmx512m

    ok, save and exit!

  9. chmod some permission here:
  10. chmod 777 *.sh

  11. now,type:
  12. ./startup.sh

  13. ok, now you should have the tomcat installed sucessfully on port 8080. to port it into standard HTTP (80/tcp), you need to have the connector:
  14. check your Apache version:

  15. For me I’m use apache 2.2.x, download your mod_jk accord to your apache version here:
    # mod_jk-1.2.25-httpd-2.2.4.so is for Apache 2.2.x and works with Apache 2.2.4 and later.
    # mod_jk-1.2.25-httpd-2.0.59.so is for Apache 2.0.x and works with Apache 2.0.59 and later.
    # mod_jk-1.2.25-httpd-1.3.37-eapi.so is for Apache 1.3.x with EAPI extensions and works with Apache 1.3.37 and later.
  16. cd /etc/httpd/modules/

    wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.25/i386/mod_jk-1.2.25-httpd-2.2.4.so

  17. edit your apache config:
  18. vi /etc/httpd/conf/httpd.conf
    after:
    LoadModule php4_module /usr/lib/apache/libphp4.so
    add:
    LoadModule evasive20_module /usr/lib/apache/mod_evasive20.so
    go to end of file, add:
    Include /usr/java/jdk1.5.0_12/apache-tomcat-5.5.25/conf/mod_jk.conf

  19. go create the mod_jk.conf you just added to httpd.conf
  20. cd /usr/java/jdk1.5.0_12/apache-tomcat-5.5.25/conf
    vi mod_jk.conf

    enter the following lines:

    <IfModule !mod_jk.c>
    LoadModule jk_module /usr/lib/apache/mod_jk.so
    </IfModule>

    JkWorkersFile “/usr/java/jdk1.5.0_12/apache-tomcat-5.5.25/conf/jk/workers.properties”
    JkLogFile “/usr/java/jdk1.5.0_12/apache-tomcat-5.5.25/logs/mod_jk.log”

    JkMount /*.jsp ajp13
    JkMount /servlet/* ajp13
    JkMount /servlets/* ajp13
    JkMount /*.do ajp13
    JkMount /manager/* ajp13

    JkLogLevel emerg

    mkdir /usr/java/jdk1.5.0_12/apache-tomcat-5.5.25/conf/jk
    vi /usr/java/jdk1.5.0_12/apache-tomcat-5.5.25/conf/jk/workers.properties

    # Setting Tomcat & Java Home
    workers.tomcat_home=/usr/java/jdk1.5.0_12/apache-tomcat-5.5.25
    workers.java_home=/usr/java/jdk1.5.0_12
    worker.list=ajp13
    worker.ajp13.port=8080
    worker.ajp13.host=localhost
    worker.ajp13.type=ajp13

    vi server.xml

    Before the last three lines of original server.xml file

    </Engine>
    </Service>
    </Server>

    You can add virtual host entries