You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2012/05/24 18:09:41 UTC

mod_jk trying to connect to 0.0.0.0

All,

I've recently seen two questions on the users' list and a bunch of
questions over on StackExchange/ServerFault about mod_jk trying to
connect to 0.0.0.0 instead of some sane IP address. Many have comments
saying that reverting to mod_jk 1.2.35 seems to fix the issue.

I saw that Mladen recently made a change to jk_util.c
(http://svn.apache.org/viewvc?rev=1338797&view=rev) to use memset(0)
instead of individually blanking-out the fields in the jk_ws_service_t
structure but after checking the patch, it seems that he was very
careful to ensure that certain values didn't get set to 0 but some other
appropriate value. Also, that change was made after the release of
1.2.36 so it's certainly not the cause.

I wonder if anyone can remember some similar change that may, in certain
cases, blank-out the server's IP address for mod_jk's workers.

There also might be something weird with the lookup of "localhost": on
one of the SE questions, the OP did "nslookup localhost" and the request
went to a DNS server (which returned NXDOMAIN) and didn't just
immediately get 127.0.0.1 from his machine's lookup-service.

It seems to be to be pretty stupid for someone to intentionally
configure mod_jk to use worker.host=0.0.0.0 (and most have posted
configurations indicating otherwise) so maybe there is a weird use-case
where host resolves to 0.0.0.0. Any ideas?

References:
http://markmail.org/message/v2uvl7hgttuje2nf
http://serverfault.com/questions/390313/connection-from-apache-to-tomcat-via-mod-jk-not-working
http://stackoverflow.com/questions/10663525/apache-tomcat-redirection-error-worker1-connecting-to-backend-failed

-chris


Re: mod_jk trying to connect to 0.0.0.0

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Konstantin,

On 5/24/12 12:14 PM, Konstantin Kolinko wrote:
> 2012/5/24 Christopher Schultz <ch...@christopherschultz.net>:
>>
>> There also might be something weird with the lookup of "localhost": on
>> one of the SE questions, the OP did "nslookup localhost" and the request
>> went to a DNS server (which returned NXDOMAIN) and didn't just
>> immediately get 127.0.0.1 from his machine's lookup-service.
>>
> 
> (OT) That is just how "nslookup" works. It queries DNS server and does
> not care about "hosts" file.  Simple "ping localhost" would be more
> informative.

Good point.

-chris


Re: mod_jk trying to connect to 0.0.0.0

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/5/24 Christopher Schultz <ch...@christopherschultz.net>:
>
> There also might be something weird with the lookup of "localhost": on
> one of the SE questions, the OP did "nslookup localhost" and the request
> went to a DNS server (which returned NXDOMAIN) and didn't just
> immediately get 127.0.0.1 from his machine's lookup-service.
>

(OT) That is just how "nslookup" works. It queries DNS server and does
not care about "hosts" file.  Simple "ping localhost" would be more
informative.

Best regards,
Konstantin Kolinko

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


Re: mod_jk trying to connect to 0.0.0.0

Posted by Christopher Schultz <ch...@christopherschultz.net>.
All,

On 5/24/12 12:09 PM, Christopher Schultz wrote:
> I've recently seen two questions on the users' list and a bunch of
> questions over on StackExchange/ServerFault about mod_jk trying to
> connect to 0.0.0.0 instead of some sane IP address. Many have comments
> saying that reverting to mod_jk 1.2.35 seems to fix the issue.

[snip]

> http://markmail.org/message/v2uvl7hgttuje2nf

The above case looks like it is heading towards blaming a worker that is
being used both in a balanced and non-balanced context (i.e. the worker
is being used under a balancer and also listed in worker.list). However,
in these cases, the configuration is very straightforward:

> http://serverfault.com/questions/390313/connection-from-apache-to-tomcat-via-mod-jk-not-working
> http://stackoverflow.com/questions/10663525/apache-tomcat-redirection-error-worker1-connecting-to-backend-failed

-chris


Re: mod_jk trying to connect to 0.0.0.0

Posted by Mladen Turk <mt...@apache.org>.
On 05/24/2012 06:09 PM, Christopher Schultz wrote:
> All,
>
> I wonder if anyone can remember some similar change that may, in certain
> cases, blank-out the server's IP address for mod_jk's workers.
>

The only thing that can cause that could be shared memory
which has been heavily changed. If worker somehow figures
out that address has been changed and it wasn't it'll get
updated with all zeros from shared memory.

I'll investigate that.


Regards
-- 
^TM

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