- 安装Apache和Tomcat
- 下载mod_jk http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.31/mod_jk-1.2.31-httpd-2.2.3.so
- 配置Apache /**Apache装有一个模块,这个模块叫mod_jk
/**Apache通过80端口负责解析任何静态web内容 * 任何不能解析的内容,用表达式告诉mod_jk,让mod_jk派发给相关的app server去解释。 *打开httpd.conf添加信息 **/ LoadModule jk_module modules/mod_jk-1.2.31-httpd-2.2.3.so JKWorkersFile conf/work.properties //配置虚拟主机 <VirtualHost *> ServerAdmin localhost DocumentRoot F:/Server/resource ServerName localhost DirectoryIndex index.html index.jsp ErrorLog logs/error_log.txt //匹配以下格式的都交给Tomcat处理 JkMount /*WEB-INF ajp13 JkMount /*.action ajp13 JkMount /*.jsp ajp13 </VirtualHost> /** *配置jkproperties */ workers.tomcat_home=F:/tomcat workers.java_home=D:/Eclipse/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013 ps=/ work.lis=test work.test.port=8009 work.test.host=localhost work.test.type=ajp13
- 重启tomcat,重启Apache,输入http://localhost/ index.jsp 和http://localhost:8080/Test/index.jsp 页面结果一样就成功了