一.软件安装及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
<virtualhost *>
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
</virtualhost>
其中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的欢迎界面。
闽公网安备 35060202000074号