mod_jk is used to redirect the requests which comes to port 80 to port 8080 or to tomcat
Step 1: wget http://apache.techartifact.com/mirror//tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz
Step 2: tar -zxvf tomcat-connectors-1.2.37-src.tar.gz
Step 3:cd tomcat-connectors-1.2.37-src
Step 4: cd native
Step 5: ./configure --with-apxs=/usr/sbin/apxs
Step 6: make
Step 7: cd apache-2.0/
Step 8: cp mod_jk.so /usr/lib64/httpd/modules/
Step 9: cd /etc/httpd/conf.d
vim mod_jk.conf
=====================================
LoadModule jk_module modules/mod_jk.so
# Declare the module for <IfModule directive> (remove this line on Apache 2.0.x)
# AddModule mod_jk.c
# Where to find workers.properties
JkWorkersFile /etc/httpd/conf.d/workers.properties
# Where to put jk shared memory
JkShmFile /var/log/httpd/mod_jk.shm
# Where to put jk logs
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 servlet for context /examples to worker named worker1
#JkMount /examples/servlet/* worker1
# Send JSPs for context /examples to worker named worker1
#JkMount /examples/*.jsp worker1
JkMount /* node1
JKOptions +DisableReuse
===================================
Step 10: vim /etc/httpd/conf.d/workers.properties
====================================
# Define list of workers that will be used
# for mapping requests
worker.list=node1
# Define Node1
worker.node1.port=8009
worker.node1.host= localhost
worker.node1.type=ajp13
worker.node1.lbfactor=1
#worker.node1.local_worker=1 (1)
worker.node1.cachesize=10
===================================
Step 11: /etc/init.d/httpd restart
Step 1: wget http://apache.techartifact.com/mirror//tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz
Step 2: tar -zxvf tomcat-connectors-1.2.37-src.tar.gz
Step 3:cd tomcat-connectors-1.2.37-src
Step 4: cd native
Step 5: ./configure --with-apxs=/usr/sbin/apxs
Step 6: make
Step 7: cd apache-2.0/
Step 8: cp mod_jk.so /usr/lib64/httpd/modules/
Step 9: cd /etc/httpd/conf.d
vim mod_jk.conf
=====================================
LoadModule jk_module modules/mod_jk.so
# Declare the module for <IfModule directive> (remove this line on Apache 2.0.x)
# AddModule mod_jk.c
# Where to find workers.properties
JkWorkersFile /etc/httpd/conf.d/workers.properties
# Where to put jk shared memory
JkShmFile /var/log/httpd/mod_jk.shm
# Where to put jk logs
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 servlet for context /examples to worker named worker1
#JkMount /examples/servlet/* worker1
# Send JSPs for context /examples to worker named worker1
#JkMount /examples/*.jsp worker1
JkMount /* node1
JKOptions +DisableReuse
===================================
Step 10: vim /etc/httpd/conf.d/workers.properties
====================================
# Define list of workers that will be used
# for mapping requests
worker.list=node1
# Define Node1
worker.node1.port=8009
worker.node1.host= localhost
worker.node1.type=ajp13
worker.node1.lbfactor=1
#worker.node1.local_worker=1 (1)
worker.node1.cachesize=10
===================================
Step 11: /etc/init.d/httpd restart
No comments:
Post a Comment