On Sun, 2012-07-22 at 10:32 -0700, k9...@operamail.com wrote:
> Hi,
> 
> On Sun, Jul 22, 2012, at 01:24 PM, Tim Watts wrote:
> > On Sun, 2012-07-22 at 08:03 -0700, k9...@operamail.com wrote:
> > >           Linux svr 3.1.10-1.16-desktop #1 SMP PREEMPT Wed Jun 27
> > >           05:21:40 UTC 2012 (d016078) x86_64 x86_64 x86_64
> > >           GNU/Linux
> > > 
> > > IPv4 is enabled on the server.  The IPv6 stack is also enabled, and
> > > necessarily configured as,
> > > 
> > >   grep bindv6only /etc/sysctl.conf
> > >           net.ipv6.bindv6only = 1
> > > 
> > > I want Tomcat listening on the IPv4 localhost @ 127.0.0.1.
> > 
> > So you want Tomcat to listen on all IPv6 addresses plus the IPv4
> > loopback address but no other IPv4 addresses?
> 
> No.  I want Tomcat7 to listen ONLY on one address: the IPv4 loopback @
> 127.0.0.1.  No other IPv4 addresses, and no IPv6 addresses at all.
> 
Oh, that's easy: specify address="127.0.0.1" on your <Connector>.  

By default, Tomcat will listen on port 8080 on all available addresses
(IPv6 and 4, barring configuration settings at the OS level).  The key
"word" in those java.net properties is "prefer" (i.e. not "require").
So the door is still open to IPv6 even with these properties.

BTW, not that it will impact you, but it's java.net.preferIPv6Addreses
(defaults to false):
>         -Djava.net.preferIPv4Addresses=true

> Specifying a listener proptocol, address & port should be a fairly
> commonplace undertaking ...
> 
> > Since you've told the OS to not allow IPv4 connections on IPv6 sockets,
> > I believe you would need to configure a separate <Connector> on the same
> > port for the IPv4 loopback address.
> 
> Not sure if this, then, still holds.
> 
Sounds like you don't need an additional <Connector>.  Just modify the
existing one.

> I'd understaood that those 'use IPv4' -D options should do exactly what
> I intend to here.   Apparently not, though ...
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to