I'm pretty sure I've got all the settings and configurations down ie, worker.properties, uriworkermap.properties. I'm curious as to how you reference a file or resource under a certain Context or webapp from the browser itself. Obviously when going thru the Apache webserver you can't enter localhost:8080//file.
2 Answers
- Have apache load mod_jk with
LoadModule jk_module mod_jk.so
- Specify your workers.properties file in the apache config with
JkWorkersFile workers.properties
- Route traffic from apache to tomcat in the apache config with
JkMount /*.jsp wlb
where wlb is defined in your workers.properties file.
See also: http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html#Simple%20configuration%20example
Just guessing, and this type of solution would be messy, but here is a thought:
Use mod_jk's JkMount directive to assign specific URLs to Tomcat. In general the structure of a JkMount directive is:
JkMount <URL prefix> <Worker name>
If example the following directives will send all requests ending in .jsp or beginning with /servlet to the "ajp13" worker, but jsp requests to files located in /specificworker will go to "specificworker", where specificworker is a non-AJP HTTP:8_80 worker with one member.
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /specificworker1/*.jsp specificworker1
JkMount /specificworker2/*.jsp specificworker2