[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    Re: Sessions hanging around . . . apparently left by a health-check
From:       Mark Thomas <markt () apache ! org>
Date:       2019-01-30 11:26:19
Message-ID: 4330bc1b-f4a0-6a40-4f25-21a81c8f50e4 () apache ! org
[Download RAW message or body]

On 30/01/2019 01:18, James H. H. Lampert wrote:
> On 1/28/19, 1:21 AM, Mark Thomas wrote:
>> http://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Crawler_Session_Manager_Valve
>>
>>
>> Set the crawler user agent and/or crawler IP appropriately so your
>> load-balancer is treated as a web-crawler and all those health-checks
>> will be associated with a single session.
> 
> Forgive me; I'd completely forgotten that I'd asked about this last
> Friday, didn't recognize the subject line until Mark's reply to
> Christopher, and just now had to fish the other two messages out of the
> trash folder.
> 
> This is actually the first I've even heard of valves, at least in this
> context, so I'm speaking from near-total ignorance, and just beginning
> to read the doc you pointed me to.
> 
> I'm guessing that this valve would go somewhere in tomcat8/conf/server.xml?

Yes. A Valve can be nested inside a Engine, Host, Context or Wrapper.
(You won't see Wrapper in server.xml - it represents a Servlet)

So something like:

<Host ... >
   <Valve className="... />
   ...
</Host>

should work for you use case.

> I don't quite get the Java regex syntax, but I'm sure that my colleague
> responsible for the webapp can help me there.
> 
> My real problem is that I haven't the slightest idea what the health
> check requests are specifying as user agent, or how to determine that,
> and they appear to be coming from at least three different IP addresses.
> I looked in the session list from the Manager, and I looked at
> catalina.out, localhost....log, and localhost_access_log....txt, and
> while I found the apparent IP addresses, I saw nothing that appeared to
> identify a user agent.

That won't matter.

> Incidentally, what's the relationship between the "crawlerIps" and
> "crawlerUserAgents" attributes? Is it an "or" or an "and"?

It is an "OR" so you can leave crawlerUserAgents as the default and just
set crawlerIps.

If the IPs were 127.0.0.1 and 127.0.0.2 then I think you want

crawlerIps="127\.0\.0\.1|127\.0\.0\.2"

HTH,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic