当前位置: 技术问答>linux和unix
一机多tomcat实例问题
来源: 互联网 发布时间:2016-10-09
本文导语: 现在已经可以通过Apache启动成功.但是现在的Action为什么不自动转向Tomcat来加载动态项呢 ServerAdmin vit.wen@gmail.com DocumentRoot /home/apache-tomcat-6.0.24/webapps ServerName localhost ServerAlias localhost Er...
现在已经可以通过Apache启动成功.但是现在的Action为什么不自动转向Tomcat来加载动态项呢
ServerAdmin vit.wen@gmail.com
DocumentRoot /home/apache-tomcat-6.0.24/webapps
ServerName localhost
ServerAlias localhost
ErrorLog logs/tomcat1_log
CustomLog logs/tomcat1_log common
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
ServerAdmin vit.wen@gmail.com
DocumentRoot /home/tomcat1/webapps
ServerName localhost
ServerAlias localhost
ErrorLog logs/tomcat2_log
CustomLog logs/tomcat2_log common
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
ServerAdmin vit.wen@gmail.com
ServerName localhost
ErrorLog logs/tomcat_log
CustomLog logs/tomcat_log common
ProxyPass / balancer://RHEL5-1/ stickysession=jsessionid nofailover=On
ProxyPassReverse / balancer://RHEL5-1/
上面两个是指定Tomcat所在路径,最后一个是配置多Tomcat来进行自动分配权重
ProxyRequests Off
BalancerMember ajp://210.1.5.102:8009 loadfactor=2 route=jvm1
BalancerMember ajp://210.1.5.102:8010 loadfactor=2 route=jvm2
这上面是在httpd.conf里配置tomcat映像
worker.list=worker1
#Tomcat1实例配置
worker.jvm1.port=8009
worker.jvm1.host=localhost
worker.jvm1.type=ajp13
worker.jvm1.lbfactor=1
#Tomcat2配置
worker.jvm2.port=8010
worker.jvm2.host=localhost
worker.jvm2.type=ajp13
worker.jvm2.lbfactor=1
worker.worker1.type=lb
worker.worker1.balanced_workers=jvm1,jvm2
worker.worker1.local_worker_only=1
worker.worker1.method=B
worker.worker1.sticky_session=1
worker.worker1.sticky_session_force=0
这个是worker.properties属性文件
# 指出mod_jk模块工作所需要的工作文件workers.properties的位▒|.
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat,让Tomcat来处▒~F
JkMount /servlet/* worker1
JkMount /*.jsp worker1
JkMount /*.do worker1
#JkMount /*.html worker1
#JkMount /* worker1
JkMount /*action* worker1
JkMount /*.xform* worker1
JKMount /*form* worker1
这些个是mod_jk.conf配置文件
问题:html文件啥的静态的图片什么都可以通过Apache来加载到...遇到像Action类.jsp处理的东西的时候看台反映的log文件.没有找到类文件啥的..好像没有转发到tomcat来请求..很郁闷啊...
请朋友指点一下!!!谢谢
ServerAdmin vit.wen@gmail.com
DocumentRoot /home/apache-tomcat-6.0.24/webapps
ServerName localhost
ServerAlias localhost
ErrorLog logs/tomcat1_log
CustomLog logs/tomcat1_log common
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
ServerAdmin vit.wen@gmail.com
DocumentRoot /home/tomcat1/webapps
ServerName localhost
ServerAlias localhost
ErrorLog logs/tomcat2_log
CustomLog logs/tomcat2_log common
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
ServerAdmin vit.wen@gmail.com
ServerName localhost
ErrorLog logs/tomcat_log
CustomLog logs/tomcat_log common
ProxyPass / balancer://RHEL5-1/ stickysession=jsessionid nofailover=On
ProxyPassReverse / balancer://RHEL5-1/
上面两个是指定Tomcat所在路径,最后一个是配置多Tomcat来进行自动分配权重
ProxyRequests Off
BalancerMember ajp://210.1.5.102:8009 loadfactor=2 route=jvm1
BalancerMember ajp://210.1.5.102:8010 loadfactor=2 route=jvm2
这上面是在httpd.conf里配置tomcat映像
worker.list=worker1
#Tomcat1实例配置
worker.jvm1.port=8009
worker.jvm1.host=localhost
worker.jvm1.type=ajp13
worker.jvm1.lbfactor=1
#Tomcat2配置
worker.jvm2.port=8010
worker.jvm2.host=localhost
worker.jvm2.type=ajp13
worker.jvm2.lbfactor=1
worker.worker1.type=lb
worker.worker1.balanced_workers=jvm1,jvm2
worker.worker1.local_worker_only=1
worker.worker1.method=B
worker.worker1.sticky_session=1
worker.worker1.sticky_session_force=0
这个是worker.properties属性文件
# 指出mod_jk模块工作所需要的工作文件workers.properties的位▒|.
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat,让Tomcat来处▒~F
JkMount /servlet/* worker1
JkMount /*.jsp worker1
JkMount /*.do worker1
#JkMount /*.html worker1
#JkMount /* worker1
JkMount /*action* worker1
JkMount /*.xform* worker1
JKMount /*form* worker1
这些个是mod_jk.conf配置文件
问题:html文件啥的静态的图片什么都可以通过Apache来加载到...遇到像Action类.jsp处理的东西的时候看台反映的log文件.没有找到类文件啥的..好像没有转发到tomcat来请求..很郁闷啊...
请朋友指点一下!!!谢谢
|
配置虚拟主机的时候加上
JkMountFile conf/urimap.properties
JkMountFile conf/urimap.properties
|
比如:
ServerAdmin vit.wen@gmail.com
DocumentRoot /home/tomcat1/webapps
ServerName localhost
ServerAlias localhost
ErrorLog logs/tomcat2_log
CustomLog logs/tomcat2_log common
JkMountFile conf/urimap.properties
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
ServerAdmin vit.wen@gmail.com
DocumentRoot /home/tomcat1/webapps
ServerName localhost
ServerAlias localhost
ErrorLog logs/tomcat2_log
CustomLog logs/tomcat2_log common
JkMountFile conf/urimap.properties
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
|
不懂,路过,纯帮顶~~