Posted on 2007-12-25 15:20
Kevin Meng 阅读(229)
评论(0) 编辑 收藏
apache 2.2.3
tomcat 5.028
下载 mod_jk.so(
http://www.blogjava.net/Files/menglikun/mod_jk2.rar )放到D:\Apache2.2\modules
修改D:\Apache2.2\conf\httpd.conf在后面加以下代码
# Using mod_jk2.dll to redirect dynamic calls to Tomcat
LoadModule jk_module modules\mod_jk2.so
JkWorkersFile "conf\workers.properties"
JkLogFile "logs\mod_jk2.log"
JkLogLevel debug
JkMount /*.jsp worker1
JkMount /szmap3/* worker1
在D:\Apache2.2\conf\httpd.conf中新建workers.properties加入代码
workers.tomcat_home=d:\Tomcat5.0 #让mod_jk模块知道Tomcat
workers.java_home=C:\jdk1.5 #让mod_jk模块知道j2sdk
ps=\ #指定文件路径分割符
worker.list=worker1
worker.worker1.port=8009 #工作端口,若没占用则不用修改
worker.worker1.host=localhost #Tomcat服务器的地址
worker.worker1.type=ajp13 #类型
worker.worker1.lbfactor=1 #负载平衡因数
为避免出现乱码,必须修改tomcat安装目录下的conf/server.xml,修改以下配置
<Connector port="8009" protocol="AJP/1.3" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" redirectPort="8443"
URIEncoding="GBK">
</Connector>
重新启动apache就可以了