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-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org