You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2013/03/03 15:44:46 UTC

Re: mod_jk how to add JK_WORKER_NAME to http-header

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

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.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEzYd4ACgkQ9CaO5/Lv0PAkxQCfXaBIxrcDzt2IeYPXCEPgivpx
8MQAn2CmDRb19+P+Gtfj/WUfQW+C9soP
=9a/c
-----END PGP SIGNATURE-----

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


Re: mod_jk how to add JK_WORKER_NAME to http-header

Posted by Rainer Jung <ra...@kippdata.de>.
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