port=8009
host=localhost
<!--worker,必须的。-->
#define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
<!--url mapping,我的主要是.jsp和struts的.do,servlet的话设置成[uri:/xxx/*]之类的。-->
#uri mapping
[uri:/*] #和第一种方式一样吧^_^
[uri:/*.jsp]
[uri:/*.do]
worker=ajp13:localhost:8009
在httpd.conf中,在LoadModule那里加入这句:
LoadModule jk2_module modules/mod_jk2.so
在最后加入这句:
JkSet config.file "conf/work.properties"
这是告诉apache去哪里找jk的配置的,根据具体情况修改。
还要修改一下DirectoryIndex,DirectoryIndex index.html index.html.var index.jsp查找“listen”用于本机测试时:Listen 127.0.0.1:80,我的是这样设置的Listen *:80。
当然还有我们的虚拟目录:
<VirtualHost *:80>
ServerAdmin darkxie@hotmail.com
DocumentRoot F:/uutang/uutang
ServerName dark
ErrorLog logs/ErrorLog.txt
CustomLog logs/CustomLog.txt common
#JkMount /servlet/* ajp13
#JkMount /*.jsp ajp13
#JkMount /*.do ajp13
</VirtualHost>
步骤3:tomcat配置
Tomcat的端口设置为8080。
在/conf文件夹加入jk2.properties文件,其内容如下:
# Set the desired handler list
handler.list=apr,request,channelSocket
#
# Override the default port for the socketChannel
channelSocket.port=8009
TOMCAT自己已经生成了这个文件,找到相关的地方把注视去掉改一下就成。
注意:用这种方式整合最好是自己编译mod_jk2.so文件,特别是在unix/linux下,我没有环境,制作mod_webapp.so没有自己作过。具体方法,自己去找吧。
| 对此文章发表了评论 |
