Jo jag har också varit inne och nosat i källkoden tidigare ;)
Men vad det än står där så hindrar det inte att diverse andra problem kan dyka upp.
Här är ett utdrag som beskriver problemet:
http://www.aexx.net/arcane/article.jsp?article=tomcat4-apache2-jk2 (punkt 13) skrev:
One would hope that a simple extension of the technique presented in the previous section would allow us to deploy web applications inside of Apache <VirtualHost> directives. Unfortunately, this is not the case as far as I have been able to determine. It would appear that specifying a <Location> inside of a <VirtualHost> will cause all of the VirtualHosts that don't explicitly override that location to suddenly begin using mod_jk2! If you're trying to give one virtual host access to Tomcat, you will inadvertently give all of them access (or, perhaps worse, you may suddenly cause one person's content to appear to be another person's content - it gets pretty nasty).
So, the way around this is to revert to using workers2.properties. It's kind of entertaining, because the official mod_jk2 documentation on the Apache website actually has a comment in it suggesting that all of the entries in workers2.properties get moved to httpd.conf, particularly for virtual hosts. Drat!
Let's say that I want only https://www.aexx.net to have access to the tomcat-docs webapp. Well, what I need to do is make the following entry in my workers2.properties (altered lines in red):
# Define the communication channel [channel.socket:localhost:8009] tomcatId=localhost:8009 [ajp13:localhost:8009] channel=channel.socket:localhost:8009 #[uri:/examples/*] #worker=ajp13:localhost:8009 [uri:https://www.aexx.net/docs/*] worker=ajp13:localhost:8009
This will restrict the allowable URLs to only those that start with www.aexx.net. Don't forget to comment-out or delete the <Location> tag in httpd.conf:
# <Location "/docs/*"> # JkUriSet worker ajp13:localhost:8009 # </Location>
The logical extension of this is to add one such entry for each virtual host you plan to give access to. If you find a better way to do this, I would really love to hear about it - please use the link at the bottom of this article to send me a message!
Här några länkar som beskriver dom problem som finns och har funnits med JkUriSet.
http://www.aexx.net/arcane/article.jsp?article=tomcat4-apache2-jk2 (punkt 13)
http://hopdev.helma.org/doczone/mod+jk2/ (Note längst ner)
"mod_jk2 doesn't handle vhosts correctly when using the JkUriSet commands"
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18472
"mod_jk2 2.0.4 does not work with existing configuration"
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28016
"JkUriSet does not set the hostname"
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18569
Jag tycker att det bästa hade varit om man gjorde all konfiguration i httpd.conf med Apaches utmärkta syntax, men än så länge verkar det finnas rejäla buggar kvar så jag håller mig till workers2.properties till nästa bugfix av mod_jk2 iaf. :)