首先安裝好apache和tomcat,還有JDK,這就不說了,我的版本依次是apache2.2.10 ,tomcat 6.0.18,jdk1.6.0_05 。
找到 httpd.conf ,修改
<IfModule dir_module>
DirectoryIndex index.html index.htm index.jsp
</IfModule>
在httpd.conf最後加
LoadModule jk_module modules/mod_jk.so
JkWorkersFile "f:/apache-tomcat-6.0.18/conf/workers.properties"
JkMount /servlet/* ajp13
JkMount /*.jsp ajp13
在tomcat的server.xml加上<Context path="" docBase="f:/web"/> (配置主目錄)
把workers.properties放到tomcat的conf檔案夾下
把mod_jk.so放到apache的modules下
workers.properties檔案的內容為:
workers.tomcat_home="f:/apache-tomcat-6.0.18"
workers.java_home="C:/Program Files/Java/jdk1.6.0_05"
ps=/
worker.list=ajp13 (mod_jk的模組版本)
worker.ajp13.port=8009 (mod_jk的工作連接埠)
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
mod_jk.so的:
http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.26/
找到與自己apache對應的版本,我這裡選擇
http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.26/mod_jk-1.2.26-httpd-2.2.4.so