sobota, 1 października 2011

mod_jk

Using mod_jk with apache 2.2.x and Tomcat


1. Download mod_jk connector from Apache Tomcat website ( http://tomcat.apache.org/connectors-doc/ )
2. Copy mod_jk.so library to modules directory of apache server.
3. Add to apache httpd.conf  file the following records (e.g. to the bottom of the file):


# Load mod_jk module
LoadModule jk_module modules/mod_jk.so 
# Declare the module for <IfModule directive>
#AddModule mod_jk.c 
# Where to find workers.properties
JkWorkersFile conf/workers.properties 
# Where to put jk logs
JkLogFile logs/mod_jk.log 
# Set the jk log level [debug/error/info]
JkLogLevel info 
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " 
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories 
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T" 
# Send servlet for context /examples to worker named worker1
JkMount /* worker1 


4. Create workers.properties file:


  # Define 1 real worker using ajp13
  worker.list=worker1
  # Set properties for worker1 (ajp13)
  worker.worker1.type=ajp13
  worker.worker1.host=localhost
  worker.worker1.port=8009

5. Restart Apache Tomcat server.

Using mod_jk with apache 2.2.x and GlassFish 3.1


1. Do steps 1-4 as for Tomcat, and additionally:
2. Login to admin panel, and add JVM parameter:

-Dcom.sun.enterprise.web.connector.enableJK=8009
3. Restart server

Should work...

Brak komentarzy:

Prześlij komentarz