mod_jk安装及配置

mod_jk:tomcat实现了ajp server side,而mod_jk实现了ajp client side

 

(1)在tomcat目录中找前缀为tomcat-connectors文件名的文件,编译并安装

tar -xzvf tomcat-connectors-1.2.30-src.tar.gz
cd tomcat-connectors-1.2.30-src
./configure --with-apxs=/usr/local/apache-test/bin/apxs
make
make install

 

(2)编辑httpd.conf

vi conf/httpd.conf
# Load mod_jk module
LoadModule    jk_module /usr/local/apache-test/modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile /usr/local/apache-test/conf/workers.properties
# Where to put jk logs
JkLogFile     /usr/local/apache-test/logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel   debug
# 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 /docs to worker named tomcat1
JkMount /examples/servlets/* tomcat1

(3)编辑worker.properties文件

vi conf/worker.properties
worker.list=tomcat1
worker.tomcat1.type=ajp13
worker.tomcat1.host=192.168.51.9
worker.tomcat1.port=9902
# worker "tomcat1" uses up to 150 sockets, which will stay no more than
# 10 minutes in the connection pool.
worker.tomcat1.connection_pool_size=150
worker.tomcat1.connection_pool_timeout=600
# worker "tomcat1" will ask the operating system to send a KEEP-ALIVE
# signal on the connection.
worker.tomcat1.socket_keepalive=1
# mount can be used as an alternative to the JkMount directive
# worker.tomcat1.mount=/c /c/*

(4)编辑server.xml文件
<Connector port="9902" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

你可能感兴趣的:(tomcat,servlet,Module,ssl,Signal,Sockets)