nginx+tomcat---apache+tomcat
nginx+tomcat
apache+tomcat
# yum install httpd httpd-devel -y
# tar xf tomcat-connectors-1.2.42-src.tar.gz
# cd tomcat-connectors-1.2.42-src/native/
# ./configure --with-apxs
# make && make install
# cd ../conf
# cp httpd-jk.conf /etc/httpd/conf.d/
# cp uriworkermap.properties workers.properties /etc/httpd/conf
# vim /etc/httpd/conf.d/httpd-jk.conf
JkWorkersFile conf/workers.properties #定义线程的文件JkMountFile conf/uriworkermap.properties #定义uri和线程的映射关系的文件
# sed -r '/^#|^!|^$/d' /etc/httpd/conf/uriworkermap.properties/*.jsp=balancer #jsp网页由哪个线程处理
/jk-manager=jk-manager
/jk-status=jk-status
# sed -r '/^#|^!|^$/d' /etc/httpd/conf/workers.properties
worker.list=jk-status
worker.jk-status.type=status
worker.jk-status.read_only=true
worker.list=jk-manager
worker.jk-manager.type=status
worker.list=balancer
worker.balancer.type=lb
worker.balancer.error_escalation_time=0
worker.balancer.max_reply_timeouts=10
worker.balancer.balance_workers=node1,node2
worker.node1.reference=worker.template
worker.node1.host=192.168.10.12
worker.node1.port=8009
worker.node1.lbfactor=1
worker.node1.activation=A
worker.node2.reference=worker.template
worker.node2.host=192.168.10.13
worker.node2.port=8009
worker.node2.lbfactor=1
worker.node2.activation=A
worker.template.type=ajp13
worker.template.socket_connect_timeout=5000
worker.template.socket_keepalive=true
worker.template.ping_mode=A
worker.template.ping_timeout=10000
worker.template.connection_pool_minsize=0
worker.template.connection_pool_timeout=600
worker.template.reply_timeout=300000
worker.template.recovery_options=3
# systemctl restart httpd