)
3. 新建文件为APAHCE_HOME\conf\workers2.properties
内容如下
[shm]
file=${serverRoot}/logs/shm.file
size=1048576
# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
[status:status]
# Uri mapping
# 状态监控的uri
[uri:/jkstatus/*]
worker=status:status
# Uri mapping
#将所jsp文件的请求通过ajp方式交由tomcat处理
[uri:/*.jsp]
worker=ajp13:localhost:8009
# Uri mapping
#将所有文件的请求通过ajp方式交由tomcat处理
[uri:/*]
worker=ajp13:localhost:8009
[uri:/examples/*]
worker=ajp13:example
(
[shm]
file=${serverRoot}/logs/shm.file
size=1048576
#The socket channel
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
#define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
#uri mapping
[uri:/*.jsp]
worker=ajp13:localhost:8009
)
说明:# Uri mapping---要想通过Apahce访问servlet有些东东必须加上的,以后我们会用上的。
4.修改TOMCAT_HOME\conf\jk2.properties只剩下以下两行,也可以不修改的
# The default port is 8009 but you can use another one
# channelSocket.port=8019
现在你要测试一下,看看Apache和Tomcat是否一起工作了
在浏览器里面输入:
http://localhost/test/testJNDI.jsp
如果出现”hello dxm”的字样,说明整合成功。构建好了一个J2EE的开发环境(全文完)。