You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Christoph P.U. Kukulies" <ku...@kukulies.org> on 2015/12/01 18:49:14 UTC

Re: tomcat7 installs to connect to ipv6:::8080 on Ubuntu 14.04

Hi Chris,

it is (was) in server.xml: (I now only have tomcat listening on port 
8009 proxy_ajp)


<Connector port="8080" protocol="HTTP/1.1"
                connectionTimeout="20000"
                URIEncoding="UTF-8"
                address="0.0.0.0" redirectPort="8443" />

I then did a
service tomcat7 restart
netstat -an | grep 8080


and saw tcp6 still listed and no tcp

Now it look like this: (after enabling ipv6 in sysctl.conf again):

tcp        0      0 127.0.0.1:49393 127.0.0.1:8009          ESTABLISHED
tcp        0      0 127.0.0.1:49395 127.0.0.1:8009          ESTABLISHED
tcp6       0      0 :::8009 :::*                    LISTEN
tcp6       0      0 127.0.0.1:8009 127.0.0.1:49395         ESTABLISHED
tcp6       0      0 127.0.0.1:8009 127.0.0.1:49393         ESTABLISHED



Am 30.11.2015 um 19:01 schrieb Christopher Schultz:
> Christoph,
>
> On 11/30/15 8:20 AM, Christoph P.U. Kukulies wrote:
>> Am 30.11.2015 um 12:12 schrieb Mark Thomas:
>>> On 30/11/2015 10:51, Christoph P.U. Kukulies wrote:
>>>> I installed tomcat7 (apt-get) on an Ubuntu 14.04.3 LTS machine and found
>>>> it being installed as listening
>>>> to
>>>>
>>>> tcp6      0        0     :::8080         :::*                 LISTEN
>>>>
>>>> How can I turn that to
>>>>
>>>> tcp        0      0 0.0.0.0:8080            0.0.0.0:* LISTEN
>>>>
>>>>
>>>> Do I have to disable ipv6 in Ubuntu first or can I switch that by
>>>> tweaking some config file or so?
>>> Try setting the address attribute of the connector to "0.0.0.0"
>>>
>>> Mark
>>>
>> You mean in server.xml: in the <Connector />  section address="0.0.0.0" ?
>> Doesn't seem to work.
>>
>> I finally got rid of it by adding the lines
>>
>> |net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 =
>> 1 net.ipv6.conf.lo.disable_ipv6 = 1 to /etc/sysctl.conf and rebooted
>> Ubuntu. |
> You should not have to disable IPv6 across the whole machine in order to
> bind to the IPv4 interface.
>
> Post your address="0.0.0.0" configuration. How did you verify the
> behavior after the change?
>
> Did you also try CATALINA_OPTS="-Djava.net.preferIPv4Stack=true"?

No, did not try this but will do so.
Cheers,

Christoph



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


Re: tomcat7 installs to connect to ipv6:::8080 on Ubuntu 14.04

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

On 2/22/16 10:56 AM, Christoph P.U. Kukulies wrote:
> Being at the problem again since I would like to run haproxy against
> tomcat7.
> 
> Here are my connectors:
> <Connector port="8080" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
>      proxyName="test.mydomain.org" maxThreads="150" enableLookups="false"
>      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
>      disableUploadTimeout="true" address="0.0.0.0" />
> <Connector port="8081" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
>      proxyName="www.foobar.de" maxThreads="150" enableLookups="false"
>      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
>      disableUploadTimeout="true" address="0.0.0.0" />
> <Connector port="8082" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
>      proxyName="www.mydomain.org" maxThreads="150" enableLookups="false"
>      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
>      disableUploadTimeout="true" address="0.0.0.0" />
> <Connector port="8083" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
>      proxyName="www.other.org" maxThreads="150" enableLookups="false"
>      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
>      disableUploadTimeout="true" address="0.0.0.0" />
> <Connector port="8085" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
>      proxyName="www.foobaz.de" maxThreads="150" enableLookups="false"
>      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
>      disableUploadTimeout="true" address="0.0.0.0" />
> <Connector port="8086" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
>      proxyName="msg.foobaz.org" maxThreads="150" enableLookups="false"
>      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
>      disableUploadTimeout="true" address="0.0.0.0" />
> 
> 
> I added the address entry on each connector to no avail:
> 
> # netstat -an
> Active Internet connections (servers and established)
> Proto Recv-Q Send-Q Local Address           Foreign Address         State
> tcp        0      0 0.0.0.0:21 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:22 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:25 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:36762 0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:60000 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:2049 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:993 0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:10024 0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:10025 0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:3306 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:587 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:48397 0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:783 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:143 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:111 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:53264 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:80 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:41584 0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:38836 0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:3306 127.0.0.1:39401         ESTABLISHED
> tcp        0      0 79.80.81.82:993 73.74.75.76:4849       ESTABLISHED
> tcp        0      0 79.80.81.82:993 73.74.75.76:4867       ESTABLISHED
> tcp        0      0 79.80.81.82:22 73.74.75.76:4491       ESTABLISHED
> tcp        0      0 79.80.81.82:993 73.74.75.76:4870       ESTABLISHED
> tcp        0      0 79.80.81.82:993 73.74.75.76:4854       ESTABLISHED
> tcp        0      0 79.80.81.82:993 73.74.75.76:4873       ESTABLISHED
> tcp        0      0 79.80.81.82:993 73.74.75.76:4869       ESTABLISHED
> tcp        0      0 79.80.81.82:993 73.74.75.76:4868       ESTABLISHED
> tcp6       0      0 :::8085 :::*                    LISTEN
> tcp6       0      0 :::8086 :::*                    LISTEN
> tcp6       0      0 :::22 :::*                    LISTEN
> tcp6       0      0 :::25 :::*                    LISTEN
> tcp6       0      0 :::44001 :::*                    LISTEN
> tcp6       0      0 :::2049 :::*                    LISTEN
> tcp6       0      0 :::993 :::*                    LISTEN
> tcp6       0      0 127.0.0.1:8005 :::*                    LISTEN
> tcp6       0      0 :::42696 :::*                    LISTEN
> tcp6       0      0 :::59018 :::*                    LISTEN
> tcp6       0      0 :::587 :::*                    LISTEN
> tcp6       0      0 :::57999 :::*                    LISTEN
> tcp6       0      0 :::143 :::*                    LISTEN
> tcp6       0      0 :::111 :::*                    LISTEN
> tcp6       0      0 :::8080 :::*                    LISTEN
> tcp6       0      0 :::8081 :::*                    LISTEN
> tcp6       0      0 :::8082 :::*                    LISTEN
> tcp6       0      0 :::8083 :::*                    LISTEN
> tcp6       0      0 :::51795 :::*                    LISTEN
> tcp6       0      0 127.0.0.1:39401 127.0.0.1:3306          ESTABLISHED

Double-check that your configuration is actually being used. Setting
address="0.0.0.0" is *supposed* to tie you to the IPv4 address. Note
that most Linux TCP/IP stacks use :: to actually listen for both IPv4
and IPv6 connections. Are you mostly looking at the netstat output, or
are you finding that IPv4-only clients cannot connect?

If address="0.0.0.0" isn't working, you can always set this global JVM
parameter to force the use of IPv4. Note that you'll not be able to use
IPv6 at that point:

   -Djava.net.preferIPv4Stack=true

-chris

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


Re: tomcat7 installs to connect to ipv6:::8080 on Ubuntu 14.04

Posted by "Christoph P.U. Kukulies" <ku...@kukulies.org>.
Being at the problem again since I would like to run haproxy against 
tomcat7.

Here are my connectors:
<Connector port="8080" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
      proxyName="test.mydomain.org" maxThreads="150" enableLookups="false"
      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
      disableUploadTimeout="true" address="0.0.0.0" />
<Connector port="8081" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
      proxyName="www.foobar.de" maxThreads="150" enableLookups="false"
      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
      disableUploadTimeout="true" address="0.0.0.0" />
<Connector port="8082" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
      proxyName="www.mydomain.org" maxThreads="150" enableLookups="false"
      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
      disableUploadTimeout="true" address="0.0.0.0" />
<Connector port="8083" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
      proxyName="www.other.org" maxThreads="150" enableLookups="false"
      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
      disableUploadTimeout="true" address="0.0.0.0" />
<Connector port="8085" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
      proxyName="www.foobaz.de" maxThreads="150" enableLookups="false"
      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
      disableUploadTimeout="true" address="0.0.0.0" />
<Connector port="8086" maxHttpHeaderSize="8192" protocol="HTTP/1.1"
      proxyName="msg.foobaz.org" maxThreads="150" enableLookups="false"
      redirectPort="8443" acceptCount="100" connectionTimeout="20000"
      disableUploadTimeout="true" address="0.0.0.0" />


I added the address entry on each connector to no avail:

# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:21 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:36762 0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:60000 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:2049 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:993 0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:10024 0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:10025 0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:587 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:48397 0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:783 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:143 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:111 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:53264 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:41584 0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:38836 0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306 127.0.0.1:39401         ESTABLISHED
tcp        0      0 79.80.81.82:993 73.74.75.76:4849       ESTABLISHED
tcp        0      0 79.80.81.82:993 73.74.75.76:4867       ESTABLISHED
tcp        0      0 79.80.81.82:22 73.74.75.76:4491       ESTABLISHED
tcp        0      0 79.80.81.82:993 73.74.75.76:4870       ESTABLISHED
tcp        0      0 79.80.81.82:993 73.74.75.76:4854       ESTABLISHED
tcp        0      0 79.80.81.82:993 73.74.75.76:4873       ESTABLISHED
tcp        0      0 79.80.81.82:993 73.74.75.76:4869       ESTABLISHED
tcp        0      0 79.80.81.82:993 73.74.75.76:4868       ESTABLISHED
tcp6       0      0 :::8085 :::*                    LISTEN
tcp6       0      0 :::8086 :::*                    LISTEN
tcp6       0      0 :::22 :::*                    LISTEN
tcp6       0      0 :::25 :::*                    LISTEN
tcp6       0      0 :::44001 :::*                    LISTEN
tcp6       0      0 :::2049 :::*                    LISTEN
tcp6       0      0 :::993 :::*                    LISTEN
tcp6       0      0 127.0.0.1:8005 :::*                    LISTEN
tcp6       0      0 :::42696 :::*                    LISTEN
tcp6       0      0 :::59018 :::*                    LISTEN
tcp6       0      0 :::587 :::*                    LISTEN
tcp6       0      0 :::57999 :::*                    LISTEN
tcp6       0      0 :::143 :::*                    LISTEN
tcp6       0      0 :::111 :::*                    LISTEN
tcp6       0      0 :::8080 :::*                    LISTEN
tcp6       0      0 :::8081 :::*                    LISTEN
tcp6       0      0 :::8082 :::*                    LISTEN
tcp6       0      0 :::8083 :::*                    LISTEN
tcp6       0      0 :::51795 :::*                    LISTEN
tcp6       0      0 127.0.0.1:39401 127.0.0.1:3306          ESTABLISHED

--
Christoph

Am 01.12.2015 um 20:12 schrieb Christopher Schultz:
> Christoph,
>
> On 12/1/15 12:49 PM, Christoph P.U. Kukulies wrote:
>> it is (was) in server.xml: (I now only have tomcat listening on port
>> 8009 proxy_ajp)
>>
>> <Connector port="8080" protocol="HTTP/1.1"
>>                 connectionTimeout="20000"
>>                 URIEncoding="UTF-8"
>>                 address="0.0.0.0" redirectPort="8443" />
>>
>> I then did a
>> service tomcat7 restart
>> netstat -an | grep 8080
>>
>>
>> and saw tcp6 still listed and no tcp
>>
>> Now it look like this: (after enabling ipv6 in sysctl.conf again):
>>
>> tcp        0      0 127.0.0.1:49393 127.0.0.1:8009          ESTABLISHED
>> tcp        0      0 127.0.0.1:49395 127.0.0.1:8009          ESTABLISHED
>> tcp6       0      0 :::8009 :::*                    LISTEN
>> tcp6       0      0 127.0.0.1:8009 127.0.0.1:49395         ESTABLISHED
>> tcp6       0      0 127.0.0.1:8009 127.0.0.1:49393         ESTABLISHED
> No port :8080 in that list.
>
> -chris
>


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


Re: tomcat7 installs to connect to ipv6:::8080 on Ubuntu 14.04

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

On 12/1/15 12:49 PM, Christoph P.U. Kukulies wrote:
> it is (was) in server.xml: (I now only have tomcat listening on port
> 8009 proxy_ajp)
> 
> <Connector port="8080" protocol="HTTP/1.1"
>                connectionTimeout="20000"
>                URIEncoding="UTF-8"
>                address="0.0.0.0" redirectPort="8443" />
> 
> I then did a
> service tomcat7 restart
> netstat -an | grep 8080
> 
> 
> and saw tcp6 still listed and no tcp
> 
> Now it look like this: (after enabling ipv6 in sysctl.conf again):
> 
> tcp        0      0 127.0.0.1:49393 127.0.0.1:8009          ESTABLISHED
> tcp        0      0 127.0.0.1:49395 127.0.0.1:8009          ESTABLISHED
> tcp6       0      0 :::8009 :::*                    LISTEN
> tcp6       0      0 127.0.0.1:8009 127.0.0.1:49395         ESTABLISHED
> tcp6       0      0 127.0.0.1:8009 127.0.0.1:49393         ESTABLISHED

No port :8080 in that list.

-chris

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