整合Apache+Tomcat服务器2

整合Apache+Tomcat服务器

1. 复制mod_jk-1.2.13-apache-2.0.54.so文件到 Apache2\modules 目录。
2. Apache配置:
 apahce2\conf\httpd.conf
 httpd.conf
在此配置文件最后添加以下语句,用以支持jsp程序:

LoadModule jk_module modules/mod_jk-1.2.13-apache-2.0.54.so
JkWorkersFile "/Tomcat 5.0/conf/workers.properties"
JkMount /servlet/* ajp13
JkMount /*.jsp ajp13

3. 查看C:\Tomcat 5.0\conf\server.xml文件中有关端口“8009”是否被注释,如果是和我这的版本一致的话,不用修改。
4. 在C:\Tomcat 5.0\conf\目录下,新建文件名为“workers.properties”的文件,将如下内容复制到新建文件workers.properties中。

workers.properties
# 只复制以下内容即可:

# 这现行根据安装目录做修改
workers.tomcat_home=C:\Tomcat 5.0
workers.java_home=C:\j2sdk1.4.1_01
ps=\
# worker.list=ajp13
worker.list=ajp12,ajp13

worker.ajp12.port=8007
worker.ajp12.host=localhost
worker.ajp12.type=ajp12
worker.ajp12.lbfactor=1

worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1

worker.loadbalancer.type=lb

worker.loadbalancer.balanced_workers=ajp12, ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)classes
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)jaxp.jar

worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)parser.jar

worker.inprocess.class_path=$(workers.tomcat_home)$(ps)common$(ps)lib$(ps)jasper.jar

worker.inprocess.class_path=$(workers.tomcat_home)$(ps)common$(ps)lib$(ps)servlet.jar

worker.inprocess.class_path=$(workers.tomcat_home)$(ps)common$(ps)lib$(ps)webserver.jar

worker.inprocess.class_path=$(workers.java_home)$(ps)lib$(ps)tools.jar

worker.inprocess.cmd_line=-config

worker.inprocess.cmd_line=$(workers.tomcat_home)/conf/jni_server.xml

worker.inprocess.cmd_line=-home

worker.inprocess.cmd_line=$(workers.tomcat_home)

worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll

worker.inprocess.stdout=$(workers.tomcat_home)$(ps)inprocess.stdout

worker.inprocess.stderr=$(workers.tomcat_home)$(ps)inprocess.stderr

worker.inprocess.sysprops=tomcat.home=$(workers.tomcat_home)

5. 到此Apache 和 Tomcat整合完成,重启Apache和Tomcat服务器,用一JSP页面测试

 

你可能感兴趣的:(apache)