On 16.02.2012 21:24, André Warnier wrote:
modjkl...@comcast.net wrote:
Thanks Andre,
I'd still be interested is there's a way to have mod_jk only check for
traffic coming into mydomain.com for folder /mywebapp. I think the
current solution checks all domains, such as mydomain2.com and
mydomain3.com, etc., for a map to mydomain.com/mywebapp.
Couldn't I just have all those JkMounts defined globally, then within
the VirtualHost tags for mydomain.com, include a "JkMountCopy On"? But
that didn't work for me so I must be approaching this wrong.
Yes, you should be able to do that. But it then again depends on whether
the Adobe thing is really sending the request in the proper way. Which
right now we don't know, but which you may be able to verify using your
packet dump.
If it does not send the requests properly, then you will end up with the
same problem as before : requests not ending up in the <VirtualHost>
which you expect, and this unexpected VirtualHost knowing nothing about
a mapping for "/mywebapp".
A correct request should have at least 2 lines such as
line 1 :
GET /mywebapp/... HTTP/1.1 (could also be POST instead of GET)
then:
.. (any number of header lines, 0-n)
then:
Host: the.correct.hostname
.. (any number of header lines, 0-n)
..an empty line (CR/LF)
In the first GET or POST line, after the GET or POST it should start
with "/mywebapp", without any other prefix.
In the Host: line, there should be the hostname which you expect.
If this is not the case, then something is wrong in the Adobe client.
If the Adobe client sends proper requests, then you can try :
- remove the "JkMountCopy All" from you main configuration
- move each JkMount line inside the <VirtualHost> where it should take
effect (copying them to several <VirtualHost>'s if that is what you want)
- define your VirtualHost's as follows :
In the main configuration part :
Listen 80
...
NameVirtualHost *:80 # (1)
...
<VirtualHost *:80> # (must match (1) exactly)
Servername localhost
D0ocumentRoot /something/harmless
</VirtualHost>
<VirtualHost *:80> # (must match (1) exactly)
Servername host.mydomain.com
.. JkMount's for this VirtualHost
</VirtualHost>
etc..
This way :
- there are only name-based VirtualHost's
- the first one is the "default host", used when a request comes in
which does not match any ServerName (for example requests sent by
devious robots looking for "/phpmyadmin" and the like)
- the others will be used each by requests whose Host: header exactly
match their ServerName or ServerAlias
But again, check the Adobe requests first, otherwise you could get in
trouble again.
Variation :
If it turns out that most of your JkMount's do need to be copied into
most of your VirtualHosts, then
- still remove the JkMountCopy All
- leave the "common" JkMount's in the main config part
- put a "JkMountCopy On" in each VirtualHost that should get a copy of
these common ones
- add the specific JkMount's to each VirtualHost
IMHO the main problem is, that the OP hasn't yet seen all VHosts defined
in the Apache configuration. I'm pretty sure, that there is more than
one VHost, maybe via included config files.
The request that originally didn't work went to some other VirtualHost
element, the one that worked went to the expected VirtualHost. If the OP
wants to clean it up, he needs to carefully check the complete
configuration for additional/unwanted VirtualHosts.
If he wants to find out, which VirtualHost actually handles a request,
the one Customlog per VirtualHost trick is an easy way to check.
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org