You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Amir Mistric <am...@nemours.org> on 2006/06/15 19:24:36 UTC
mod_jk and vhosts and webapps deployed under "/" context
Hi
I was wondering if someone can tell me how to mount webapp via mod_jk when
webapp is deployed under "/" context using vhosts...
Here is the scenario:
I have 2 webapps deployed under "/" context on Tomcat using vhosts
When I access
http://webapp1.domain.ext:8080/ I get webapp1
http://webapp2.domain.ext:8080/ I get webapp2
and also a static site on Apache
http://website1.domain.ext
Everything works cool on Tomcat end (using META-INF/context.xml and <Host>
directives)...
Now I want to use Apache+mod_jk which runs on port 80 and which has several
static websites...
How do I use JkMount to moutn both webapps?
Doing
JkMount / node1
JkMount /* node1
Will not work...
My goal is to access both static sites and webapps via virtual hosts where
webapps are deployed under "/" (root) context..
I am not using any loadbalancers or similar..
Here is my tomcat.conf
----------------------------------------------------------------------
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf.d/tomcat-workers.properties
JkLogFile logs/tomcat-mod-jk_log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
# Mount your applications
# this is not working for the static sites....
JkMount / node1
JkMount /* node1
JkShmFile run/jk.shm
# Add jkstatus for managing runtime data
<Location /jkstatus/>
JkMount status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
----------------------------------------------------------------------
And my tomcat-workers.properties
----------------------------------------------------------------------
Define list of workers that will be used
# for mapping requests
worker.list=node1,status
# Define Node1
worker.node1.port=8009
worker.node1.host=server50.mydomain.org
worker.node1.type=ajp13
worker.node1.lbfactor=1
#local_worker should be commented out to enable load-balancing. Otherwise,
only fail-over is available.
#worker.node1.local_worker=1
worker.node1.cachesize=10
# Define Node2
#worker.node2.port=8009
#worker.node2.host= node2.mydomain.com
#worker.node2.type=ajp13
#worker.node2.lbfactor=1
#local_worker should be commented out to enable load-balancing. Otherwise,
only fail-over is available.
#worker.node2.local_worker=1
#worker.node2.cachesize=10
# Load-balancing behaviour
#worker.loadbalancer.type=lb
#worker.loadbalancer.balanced_workers=node1, node2
#worker.loadbalancer.sticky_session=1
#worker.loadbalancer.local_worker_only=1
#worker.list=loadbalancer
# Status worker for managing load balancer
worker.status.type=status
----------------------------------------------------------------------