Apache2.0.47和Tomcat4.1.27整合过程
参考了网上很多资料,发现大都或多或少有些小问题,现把我的整合过程贴出来,供大家参考。一、准备
需要以下程序:
j2sdk1.4.2_01,apache-2.0.47,jakarta-tomcat-4.1.27,以及mod_jk2-2.0.43.dll
以上程序都可以在sun和apache.org下载到。
j2sdk1.4.2_01 : http://java.sun.com/j2se/1.4.2/download.html选J2SE v 1.4.2_01 的SDK
apache-2.0.47 : http://apache.linuxforum.net/dist/httpd/binaries/win32/apache_2.0.47-win32-x86-no_ssl.exe
tomcat-4.1.27 : http://apache.linuxforum.net/dist/jakarta/tomcat-4/binaries/jakarta-tomcat-4.1.27.exe
mod_jk2-2.0.43.dll : http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.2/bin/win32/mod_jk2-2.0.43.dll
注意下载的jk2文件名:mod_jk2-2.0.43.dll,而网上还有mod_jk-2.0.4x.dll,这是jk而不是jk2
二、安装
假设j2sdk1.4.2_01安装到D:j2sdk1.4.2_01下,用[Java_install_dir]代表此路径
apache-2.0.47安装到D:Program FilesApache GroupApache2,用[Apache_install_dir]代表此路径,服务端口为80
jakarta-tomcat-4.1.27安装到D:Program FilesApache GroupTomcat 4.1,用[Tomcat_install_dir]代表此路径,服务端口为8080
在系统环境变量里添加JAVA_HOME和TOMCAT_HOME分别为以上路径,再修改CLASS_PATH,添加%JAVA_HOME%lib;%TOMCAT_HOME%in;
安装时把Apache和Tomcat都设置为后台服务方式运行。
三、配置
1. 在Apache2中安装mod_jk2-2.0.43.dll
将mod_jk2-2.0.43.dll拷贝到[Apache_install_dir]/modules目录中
编辑[Apache_install_dir]/conf/httpd.conf配置文件,在文件最后添加如下一行:
LoadModule jk2_module modules/mod_jk2-2.0.43.dll
2. 配置Apache端
[在Apache_install_dir]/conf目录中新建文件workers2.properties,内容如下:
# Define the comunication channel
[channel.jni:jni]
info=The jni channel, used if tomcat is started inprocess
# Define the parameters for the Java Virtual Machine
[vm:]
info=Parameters used to load a JVM in the server process
OPT=-Djava.class.path=[Tomcat_install_dir]in omcat-jni.jar;[Tomcat_install_dir]in omcat.jar
OPT=-Dtomcat.home=[Tomcat_install_dir]
补充:Jsp教程,J2EE/EJB/服务器