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

Piyush,

On 3/9/20 15:34, Piyush Kumar Nayak wrote:
> There appears to be a change in the behavior of AJP connector in
Tomcat, with respect to the protocol stack of the loopback address it
binds to.
> With older versions it binds to both IPv6 and IPv4 interface, but
with 9.0.31 it appears to bind to IPv4 only, if the address attribute
is removed from the connector config
>
> Tomcat 9.0.16 - default config <Connector port="8009"
> protocol="AJP/1.3" redirectPort="8443" /> netstat -ano | findstr
> 8009 TCP    0.0.0.0:8009           0.0.0.0:0
> LISTENING
   19832
> TCP    [::]:8009              [::]:0                 LISTENING
   19832
>
> Tomcat 9.0.31 - note that address attribute is removed... in the
standard config it is set to "::1".
> <Connector protocol="AJP/1.3" port="8009" redirectPort="8443"
secret="seckey" />
> netstat -ano | findstr 8009 TCP    127.0.0.1:8009         0.0.0.0:0
> LISTENING
   8964
>
> Even if the default is used it listens to IPv6 only <Connector
> protocol="AJP/1.3" address="::1" port="8009"
redirectPort="8443" secret="seckey" />
> TCP    [::1]:8009             [::]:0                 LISTENING
 3880
>
> As per the docs, the default for ipv6v6only attribute is false.
Should it not listen to both the protocol stacks.

The old default was "no address specified" and so Java would generally
bind to all interfaces.

The new default is "localhost", so it may be sensitive to the
name-resolution that your system performs when you ask it for the
interface for "localhost". If it gives only an IPv4 address, you'll
get IPv4. If only IPv6, then only IPv6. If both, then probably both.
Actually, maybe not. I don't think you can bind to two interfaces at
the same time, unless those interfaces are the "all interfaces"
metainterface.

- -chris

> -----Original Message----- From: Piyush Kumar Nayak
> <pna...@adobe.com.INVALID> Sent: Saturday, March 7, 2020 5:29 PM
> To: Tomcat Users List <users@tomcat.apache.org> Subject: RE: bind
> Tomcat to IPv4 and IPv6 loopback, Tomcat 9.0.31
>
> Chris, In both the cases, ISAPI and mod_jk, the hostname is set to
> "localhost" Tomcat and webserver are on the same host machine.
>
>
> -----Original Message----- From: Christopher Schultz
> <ch...@christopherschultz.net> Sent: Friday, March 6, 2020 8:20 PM
> To: users@tomcat.apache.org Subject: Re: bind Tomcat to IPv4 and
> IPv6 loopback, Tomcat 9.0.31
>
> Piyush,
>
> On 3/5/20 14:40, Piyush Kumar Nayak wrote:
>> Thanks Mark, Two connector configs works. Any ideas, on why the
>> behavior if different for ISAPI and mod_jk modules?
>
> What do your configurations look like for each module?
>
> -chris
>
>> -----Original Message----- From: Mark H. Wood <mw...@iupui.edu>
>> Sent: Thursday, March 5, 2020 10:28 PM To:
>> users@tomcat.apache.org Subject: Re: bind Tomcat to IPv4 and IPv6
>> loopback, Tomcat 9.0.31
>
>> On Thu, Mar 05, 2020 at 01:52:57PM +0000, Piyush Kumar Nayak
>> wrote:
>>> Is there a way to get Tomcat's AJP connector to bind to both
>>> IPv4 and IPv6 loopback addresses.
>>>
>>> By default, it seems that Tomcat binds to IPv4 loopback Default
>>>  connector config : <Connector protocol="AJP/1.3" port="8014"
>>> redirectPort="8447" packetSize="65535" secret="xxx"
>>> tomcatAuthentication="false"/>
>>>
>>> netstat -ano | findstr 8014 TCP 127.0.0.1:8014 0.0.0.0:0
>>> LISTENING 8616 TCP 127.0.0.1:8014 127.0.0.1:57510 ESTABLISHED
>>> 8616 TCP 127.0.0.1:57510 127.0.0.1:8014 ESTABLISHED 11800
>>>
>>> Introducing the address attribute like so  : <Connector
>>> protocol="AJP/1.3" address="::1" port="8014"
>>> redirectPort="8447" packetSize="65535" secret="xxx"
>>> tomcatAuthentication="false"/> binds it to IPv6 loopback TCP
>>> [::1]:8014 [::]:0 LISTENING 8616 TCP [::1]:8014 [::1]:57522
>>> ESTABLISHED 8616 TCP [::1]:57522 [::1]:8014 ESTABLISHED 6564
>>>
>>> Is there a way to make it bind to both the loopbacks. The
>>> problem we are facing is our Tomcat installations can have
>>> connector configured with IIS or Apache HTTPD. Apache
>>> connector, by default seems to make a socket connection using
>>> the address ::1 (IPv6 loop back address), whereas IIS connector
>>> tries to bind to the IPv4 loopback.
>
>> Two things I would try:
>
>> 1.  Two connectors, one with address='::1' and the other with
>> address='127.0.0.1', both with port='8014'.
>
>> 2.  Configure the other end explicitly:  tell HTTPD and IIS which
>>  address to use, and then configure your AJP Connector to match.
>
>> -- Mark H. Wood Lead Technology Analyst
>
>> University Library Indiana University - Purdue University
>> Indianapolis 755 W. Michigan Street Indianapolis, IN 46202
>> 317-274-0749 www.ulib.iupui.edu
>
>> ---------------------------------------------------------------------
>
>>
>
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
>
>
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
> B
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB 
[  X  ܚX KK[XZ[
> \ \  ][  X  ܚX P X ] \X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[ \
> \  Z[ X ] \X K ܙ B
>
> ---------------------------------------------------------------------
>
>
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl5muxMACgkQHPApP6U8
pFjFEQ/8C1FStE/TFCkrcoXXIqZzjbkEBGNIhx46ZlcuOgNhepevbsVTja7gb3gI
Q5yyuKGS4AWAnqBJv57ixz375xiAJ+cbixNdun7/CNUprL8GhShcTvkFogaVNRb0
QVuWUfvmnH4a/vIxsQDlSPY/jF/YPMNvRXcxP/TSi1b6v7UaWfNnZ7kGEeMphDbf
5S7dDX3mS/jXgtGeEXWP/39sqhI4D1wLMXA55jRrW0oy6yUgWG+XRTt1tnObUx3W
trfiV/shX5dmxXC2UtN8yK+UmaWchZTeDfWWxV6zrjw5bF6cTDtoMY1ZcXMof5O+
ShAAQW3d8gyItBr43ORKh0FRz89T/OXS+gMJNsM2XJP6RrenoNI4e5fsAPOeDccm
HKKXoFXho6kdhF0aT2Bd5qJ2l+WMr187KGQrXFMRR4YRh+MtyCJjMeqb9NTJz3V6
lnj/NpNx5UUaEWXNuc+umHKfJ16WSWBBBrKzwulp9KBQgVmDp36uv3tWP84+oFv/
EfGquKMSWFVneqsNZW+zsIFKdPrXFzYWrBj2QxKGOJ/4XmQ8Q69G+iG/qg5i+wAe
YgPS05vZ0VREF5/KvLvGjyfR1nZCEjssiQnlsjPCv0TNkRUbN9ki5u62RDhf37f8
e4Yt4HxZ9s3MAJ281vGcPLQ/wjlEox+yC5A6t9zbmNQfX3/1glE=
=gm90
-----END PGP SIGNATURE-----

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

Reply via email to