J2EE

mod_jk installation tips

I have used Tomcat + Apache for a while - yet I have never had to do the installation myself. Recently I needed an R&D server for the Jira Services I'm developing; enter mod_jk installation. This post is for anyone that wants to install mod_jk - the right way - and avoid the nightmare documentation that currently exists.

  1. netstat to make sure you select unused ports e.g.    
            
    1. 8080: Apache
    2.       
    3. 8081: Tomcat
    4.       
    5. 8009: mod_jk
    6.    
  2. install Tomcat; verify http connection
  3. install Apache; verify http connection
  4. install mod_jk (mod_jk2 is deprecated)
  5. create $CATALINA_HOME/conf/workers2.conf    
    # configure shared memory
    file = /opt/tomcat5/logs/shm.file
    size = 1048576
    # configure tomcat worker
    worker.list = mod_jk_worker
    worker.mod_jk_worker.type = ajp13
    worker.mod_jk_worker.host = localhost
    worker.mod_jk_worker.port = 8009
    # channel only used in Windows
    worker.mod_jk_worker.channel = myTomcat
  6. modify $APACHE_HOME/conf/httpd.conf    
    LoadModule jk_module modules/mod_jk.so
    <IfModule mod_jk.c>
      JkWorkersFile /etc/apache2/conf/workers2.conf
      JkLogFile /var/log/apache2/mod_jk.log
      JkLogLevel debug
      JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
      JkRequestLogFormat "%w %V %T"
      JkMount /jira mod_jk_worker
      JkMount /jira/* mod_jk_worker
    </IfModule>

Syndicate content