快速配置JK连接器连接 APACHE 和tomcat
workers.properties 是JK连结器接口的命令配置文件
一个实例workers.properties
使用ajp13 连结Apache webserver和 Tomcat engine
workers.properties如下:
# 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
你必须有mod_jk.so(unix+liunx)下 windows下面是mod_jk.dll(早期版本) 现在的版本也是.so结尾的了 应为apache
windows版本2.0以上都是.so文件的结尾
如下官方的版本说明(下载地址)
http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.23/
Apache Tomcat JK 1.2.23 for WIN32
Here you'll find the binaries for IIS, Apache and Sun ONE Web Servers.
mod_jk-apache-1.3.37.so is for Apache 1.3, and works with Apache 1.3.37 and later. Rename to mod_jk.so before putting it in your Apache2/modules directory.
mod_jk-apache-2.0.59.so is for Apache 2.0, and works with Apache 2.0.59 and later. Rename to mod_jk.so before putting it in your Apache2/modules directory. (这个是我现在用的版本 ,配置成功 我的APACHE 是apache_2.0.55-win32-x86-no_ssl.msi)
mod_jk-apache-2.2.4.so is for Apache 2.2, and works with Apache 2.2.4 and later. Rename to mod_jk.so before putting it in your Apache2/modules directory.
isapi_redirect.dll is for IIS 5 and later Web Server.
jk_symbols.zip contans debug (.pdb) information for all modules.
在http.conf最后面加上
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module libexec/mod_jk.so
# Declare the module for <IfModule directive> ( 在apache 2.0以上不要加载了)
AddModule mod_jk.c
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /etc/httpd/conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/httpd/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# Send everything for context /examples to worker named worker1 (ajp13)
JkMount /examples/**//* worker1