一.软件安装及PATH等设置:
这一步没什么说的,按J2SDK1.4.1(当然也可以是其他版本的),Apache2.0.43,Tomcat4.1.12的顺序安装就是了。
然后再分别设置CLASSPATH,PATH,JAVA_HOME,CATALINA_HOME。
二.整合配置:
1.
下载mod_jk2-2.0.43.dll(地址:http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.1/bin/win32/mod_jk2-2.0.43.dll),并将它复制到APACHE安装目录下的modules子目录下。
2.
编辑APACHE2的配置文件httpd.conf,在文件的最后加上以下几行。
LoadModule jk2_module
modules/mod_jk2-2.0.43.dll
ServerAdmin
webmaster@dummy-host.example.com
DocumentRoot
"D:/jakarta-tomcat-4.1.12/webapps"
ServerName
dummy-host.example.com
DirectoryIndex index.htm index.html
index.jsp
ErrorLog logs/dummy-host.example.com-error_log
CustomLog
logs/dummy-host.example.com-access_log
common
其中DocumentRoot一行要与自己的TOMCAT安装目录一致。
DirectoryIndex一行是为了自动解释JSP类型的文件。
3.
在APACHE2安装目录的conf子目录下加入文件workers2.properties,其内容如下:
# Define the
communication channel
[channel.socket:localhost:8009]
info=Ajp13
forwarding over socket
tomcatId=localhost:8009
# Map All webapp to the
Web server uri space
[uri:/*]
info=Map the whole
webapp
其中,URI的部分不一定按上面的定义,可以设置对自己有用的子路径。比如只想公开examples子目录下的东东时,可以如下定义:
#
Map the Tomcat examples webapp to the Web server uri
space
[uri:/examples/*]
info=Map the whole webapp
4.
这里使用Tomcat4.1.12中缺省定义的有关端口8009的监视器,无需再作任何修正(除非是你自己已经改动了^_^)。
三.测试:
分别起动APACHE和TOMCAT(不用区分顺序),然后打开浏览器,输入http://localhost/,在上面URI配置的情况下应该显示出TOMCAT的欢迎界面。[@more@]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9650775/viewspace-921975/
,如需转载,请注明出处,否则将追究法律责任。