Question

I am trying to configure multiple instances of Tomcat (7) behind a single domain in IIS. The Tomcat instances both run on separate ports. I have installed the Tomcat isapi_rediect.dll and configured IIS.

Everything works with the redirector, except (you knew that was coming) I am being told that "all other traffic must be mapped to one of the two instances (they are very different applications). It is probably more accurate to say that all requests except a specific pattern need to be mapped to one worker and only the specific pattern (/rpt) needs to go to the other worker.

I have two workers defined in the workers.properties:

worker.list=ajp13_1,ajp13_2
worker.ajp13_1.port=8009
worker.ajp13_2.port=8010

and the following in the uriworkermap.properties:

/wxx|/*=ajp13_1
/rpt|/*=ajp13_2

with this, everything seems fine. Except some (considerable) number of request that will not include the wxx scope. I really need to map rpt and all sub content to ajp3_2 and all other requests to ajp3_1.

If I add

/|*=ajp13_1

then ajp3_2 effectively becomes unreachable and the wildchar match maps even /rpt/* URI to ajp3_1.

Is there any way to do what I am trying to do? I really appreciate any help- I have spent too much time reading the same references over and over.

Was it helpful?

Solution

The tomcat connector does its matching in two passes. The first pass includes the host, the second pass does not. So if you had a request like:

http://www.mydomain.com/rpt/somepage.jsp

the connector would try to first match "/www.mydomain.com/rpt/somepage.jsp" against the available mappings and if none of them matched it would try "/rpt/somepage.jsp". This means that the default mapping ("/*") will be the only thing that matches on that first pass since none of your other mappings account for the host. I believe you could achieve the desired results with the following:

/*/rpt|/*=ajp13_2
/|*=ajp13_1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top