apache+tomcat+jk2整合补充说明

来源:互联网 发布:反三国演义知乎 编辑:程序博客网 时间:2024/05/04 08:27
本文请结合[转]谈谈我对apache+tomcat+jk2整合的理解,说明几点:

apache2 、tomcat5、jk2安装完毕以后只需要修改以下2个文件即可;
/usr/local/apache2/conf/workers2.properties
/usr/local/apache2/conf/httpd.conf其实现效果,所有访问http://chat.host.com的服务都通过Jk2传递到Tomcat5上;


具体修改如下:
/usr/local/apache2/conf/httpd.conf
……

<VirtualHost 211.154.254.90:80>
    ServerAdmin root@host.com
    DocumentRoot /opt/host/chat
    ServerName chat.host.com
    DirectoryIndex index.html index.jsp
</VirtualHost>

LoadModule jk2_module modules/mod_jk2.so

……

 

/usr/local/apache2/conf/workers2.properties

gger]
level=ERROR

[config:]
file=/usr/local/apache2/conf/workers2.properties
debug=0
debugEnv=0

# Alternate file logger
[logger.file]
#level=DEBUG
level=ERROR
file=/var/log/httpd/jk2.log

[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=/var/log/httpd/jk2.shm
size=1048576
debug=0
disabled=0

[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009
keepalive=1

[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
debug=0

[status:]
info=Status worker, displays runtime informations

[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
worker=ajp13:localhost:8009

[uri:chat.host.com/*]
worker=ajp13:localhost:8009
context=/