Install mod_jk2

This information is now maintained on my wiki http://www.mikepalmer.net/wiki/ApacheTomcatHowto.

NOTE: mod_jk2 has been depreciated. Some of the features have been backported to mod_jk. Basically the developers got tired to making something that nobody would learn how to use. So they went back to mod_jk. You should too.

  1. go to http://apache.mirrors.redwire.net/jakarta/tomcat-connectors/jk2/ and download the current source file for mod_jk2
  2. Move the file to /usr/local/src and extract it:
    cp -p jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz /usr/local/src/
    cd /usr/local/src
    tar xvzf jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz
  3. Compile and install mod_jk2:
    cd jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2
    ./configure --with-apxs2=/usr/local/apache/bin/apxs
    make
    cd ../build/jk2/apache2/
    /usr/local/apache/bin/apxs -n jk2 -i mod_jk2.so
  4. Verify that the mod_jk2 modules are installed:
    ls /usr/local/apache/modules
    You should see mod_jk2.so in the directory.
  5. Edit /usr/local/apache/conf/httpd.conf and add the following lines:
    LoadModule jk2_module modules/mod_jk2.so
    .......
    DirectoryIndex . . . . . index.jsp
  6. Create a file named workers2.properties in /usr/local/apache/conf using your favorite editor and inject the information below:
     #
     # This is the minimal JK2 connector configuration file.
     #
    
     [logger]
     info=Native logger
     level=ERROR
    
     [config:]
     file=${serverRoot}/conf/workers2.properties
     debug=0
     debugEnv=0
    
     [uriMap:]
     info=Maps the requests.
     debug=0
    
     [shm:]
     info=Scoreboard. Required for reconfiguration and status with multiprocess servers
     file=anonymous
     debug=0
    
     [workerEnv:]
     info=Global server options
     timing=0
     debug=0
    
     [lb:lb]
     info=Default load balancer.
     debug=0
    
     [channel.socket:localhost:8009]
     info=Ajp13 forwarding over socket
     debug=0
     tomcatId=localhost:8009
    
     #[uri:/admin]
     #info=Tomcat HTML based administration web application.
     #debug=0
    
     [uri:/manager/*]
     info=A scriptable management web application for the Tomcat Web Server.
     debug=0
    
     [uri:/jsp-examples/*]
     info=JSP 2.0 Examples.
     debug=0
    
     [uri:/servlets-examples/*]
     info=Servlet 2.4 Examples.
     debug=0
    
     [uri:/servlet/*]
     info=servlets
     debug=0
    
     [uri:/*.jsp]
     info=JSP Extension mapping.
     debug=0
          
    If you want to pass additional context's to Tomcat, just add the uri and worker as needed.

Back to Tomcat Main Continue to Tomcat Shell Script