tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: mod_jk how to add JK_WORKER_NAME to http-header
Date Sun, 03 Mar 2013 20:10:03 GMT
On 03.03.2013 15:44, Christopher Schultz wrote:
> André,
> 
> On 2/27/13 3:59 AM, André Warnier wrote:
>> If I understand the original post correctly, the whole point would
>> be to know, at the httpd level, which "worker" (Tomcat) actually
>> processed this request, right ? If so, why not have the desired
>> response header added at the Tomcat level ? The more or less
>> standard workhorsse URLRewriteFilter could be used here for that.
> 
> One potential irritant is that requires you to (further?) customize
> each of your backend servers. If you could handle this at the mod_jk
> level, the app server doesn't have to collude with the web server in
> order to perform this logging.

True, but in the case of load balancing you would have to add an
individual jvmRoute to server.xml n any case. So I typically just set a
system property e.g. -Droute=node1 and use ${route} in server.xml. That
way the file stays consistent. Setting the system property can be done
in setenv.sh, where you could use shell logic to determine on what node
you are running.

Now: the same trick can be used when running without a load balancer. If
the shell script has a way to set the target name you want to be shown,
then just set a dummy system property like -Dworker=node1 and refer to
the system property "worker" in the filter.

Instead of "node!" etc. you could e.g. use the result of "uname -n" on
Linux/Unix.

Regards,

Rainer


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


Mime
View raw message