apache2.2 和Tomcat整合
1.下载Apache Http Server 2.2和Tomcat到本地安装。
2.http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries这个目录下,根据下载的Http Server 和硬件环境,下载mod_jk-1.2.26-httpd-2.2.4.so(此处根据情况下载),并重命名为:mod_jk.so,并放在Http Server/modules目录下。
3.在Http Server/conf目录下新建一个文件,名为:workers.properties
worker.list=ajp13worker.ajp13.type=ajp13 #worker.ajp13.host=172.16.66.89#worker.ajp13.host=127.0.0.1worker.ajp13.port=8009 #tomcat ajp1.3对应的端口号worker.ajp13.lbfactor=50worker.ajp13.cachesize=10worker.ajp13.cache_timeout=600worker.ajp13.socket_keepalive=1worker.ajp13.socket_timeout=300
#Where to find workers.properties#JkWorkersFile "D:/Program Files/Apache Software Foundation/Apache2.2/conf/workers.properties"#Where to put jk logs 日志路径JklogFile "D:/Program Files/Apache Software Foundation/Apache2.2/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 formatJkRequestLogFormat "%w %V %T"#Send servlet for context /examples to worker named ajp13#JkMount /servlet/* ajp13#Send JSPs for context /examples to worker named ajp13#JkMount /routonlifeSystemAdmin/* worker1#JkMount /routonlifeClient/* worker1#JkMount /notice/*.* ajp13#JkMount /routon/*.do ajp13#JkMount /routon/*.action ajp13JkMount /routon/*.* ajp13 #ajp13这个名称跟workers.properties中worker.list=ajp13要对应,表示, /routon/下所有的请求都经过ajp13协议找到对应的tomcat,由tomcat处理。