Download jakarta-tomcat-connectors-jk-1.2.4-src.tar.gz
CD/WWW
Tar-xzf jakarta-tomcat-connectors-jk-1.2.4-src.tar.gz
Music jakarta-tomcat-connectors-jk-1.2.4 mod_jk
CD/www/mod_jk/JK/native
./Buildconf
[Root @ pingtai-test2 Native] #./configure -- With-apxs =/usr/local/apache_jk/bin/apxs
Make
Cp apache-2.0/mod_jk.so/www/http2/modules/
Prepare two important configuration files
Modify httpd. conf to inform the server to load the mod_jk module. And configure it to forward specific requests to Tomcat for processing.
# ------------------- Mod_jk -------------------
Loadmodule jk_module libexec/mod_jk.so
# Declare the module for <ifmodule directive>
# Addmodule mod_jk.c
# Where to find workers. Properties
Jkworkersfile/www/http2/CONF/workers. Properties
# Where to put JK logs
Jklogfile/www/http2/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/examples/servlet/* worker1
# Send JSPs for context/examples to worker named worker1
Jkmount/examples/* worker1
Create a file/www/http2/CONF/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
Worker. worker1.lbfactor = 50
Worker. worker1.cachesize = 10
Worker. worker1.cache _ timeout = 600
Worker. worker1.socket _ keepalive = 1
Worker. worker1.socket _ timeout = 300
OK. Now we can test it.
Http: // ip/examples/JSP/index.html