We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Setup Tomcat to support IPv6

Medium Priority
6,876 Views
Last Modified: 2013-12-02
We have a Windows 2008 Server that is hosting a web site and I'm trying to get it setup to support IPv6.  I have confirmed the IPv6 connectivity to this server is working and that the Windows 2008 firewall is not blocking anything.  Currently when I try to bring up the site, from the server itself, with an IPv6 address http://[IPv6 addres]:28080 it doesn't work.  I have also tried http:[::1]:28080 and I get nothing.  From what I've seen on the Internet Tomcat 6 supports IPv6 but I'm wondering if I need some command or library added to my tomcat server.xml file or if there something else I'm missing.
Comment
Watch Question

CERTIFIED EXPERT

Commented:


is the service started on port 28080?


harbor235 ;}

Author

Commented:
Yes, of course.  It works fine on IPv4.
CERTIFIED EXPERT

Commented:

right, but is it bound to the v6 IP?

netstat -an

harbor235 ;}

Author

Commented:
We might be getting somewhere.  I do have several ports listening on [::] but not the ports or port 28080 that I need.  So then the question is how do I make Tomcat service list on port 28080 for IPv6????
CERTIFIED EXPERT

Commented:

What version of tomcat?

harbor235 ;}
CERTIFIED EXPERT

Commented:

Author

Commented:
It is Tomcat 6.0.26
CERTIFIED EXPERT

Commented:


try     [your-ipv6_address_here]:28080


harbor235 ;}
Top Expert 2015

Commented:
your URL was not right
http: / / [ : : 1 ] : 2 8 0 8 0

Author

Commented:
Yeah I didn't type it correctly in the question.  I was trying it as http: / / [ : : 1 ] : 2 8 0 8 0  Below are the ports that IV46 and IPv6 are listening to.  As we can see Tomcat isn't listening to port 28080 like it is on IPv4.   So I really think it comes to why is Tomcat 6.0.26 not listening to port 28080 on IPv6 like it does on IPv4.  Any clues?

C:\Users\administrator.STI>netstat -an

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1688           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:2301           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:2381           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:3389           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:4899           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:5666           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8009           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8081           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8400           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8402           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8600           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8686           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:12489          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:28009          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:28080          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:28686          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:47001          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:49152          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:49153          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:49154          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:49159          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:49181          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:49188          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:54331          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:54332          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:58848          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:59301          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:59302          0.0.0.0:0              LISTENING
TCP    [::]:135               [::]:0                 LISTENING
TCP    [::]:445               [::]:0                 LISTENING
TCP    [::]:1688              [::]:0                 LISTENING
TCP    [::]:2301              [::]:0                 LISTENING
TCP    [::]:2381              [::]:0                 LISTENING
TCP    [::]:3389              [::]:0                 LISTENING
TCP    [::]:8600              [::]:0                 LISTENING
TCP    [::]:8686              [::]:0                 LISTENING
TCP    [::]:28686             [::]:0                 LISTENING
TCP    [::]:47001             [::]:0                 LISTENING
TCP    [::]:49152             [::]:0                 LISTENING
TCP    [::]:49153             [::]:0                 LISTENING
TCP    [::]:49154             [::]:0                 LISTENING
TCP    [::]:49159             [::]:0                 LISTENING
TCP    [::]:49182             [::]:0                 LISTENING
TCP    [::]:54331             [::]:0                 LISTENING
TCP    [::]:54332             [::]:0                 LISTENING
TCP    [::]:58848             [::]:0                 LISTENING
TCP    [::]:59301             [::]:0                 LISTENING
TCP    [::]:59302             [::]:0                 LISTENING
UDP    0.0.0.0:123            *:*
UDP    0.0.0.0:161            *:*
UDP    0.0.0.0:500            *:*
UDP    0.0.0.0:4500           *:*
UDP    0.0.0.0:5355           *:*
UDP    0.0.0.0:8081           *:*
UDP    0.0.0.0:8082           *:*
UDP    0.0.0.0:53199          *:*
UDP    127.0.0.1:52577        *:*
UDP    127.0.0.1:58325        *:*
UDP    127.0.0.1:62588        *:*
UDP    127.0.0.1:63920        *:*
UDP    127.0.0.1:63921        *:*
UDP    172.24.1.71:137        *:*
UDP    172.24.1.71:138        *:*
UDP    [::]:123               *:*
UDP    [::]:161               *:*
UDP    [::]:500               *:*
UDP    [::]:5355              *:*
Top Expert 2015

Commented:
check http connector in server.xml
unless address is specified it should listen to both ipv6 and ip4

Author

Commented:
Here is how it's configured in the server.xml file.  

<Connector port="28080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               maxThreads="700"
               minSpareThreads="25"
               maxSpareThreads="50"
               redirectPort="28443" />
Top Expert 2015

Commented:
Which version ov Java you are using?

Author

Commented:
1.6.0_20

Author

Commented:
Any other thoughts????  It's Java 1.6.0_20
Top Expert 2015

Commented:
should not be any different starting from Java 1.5 and tomcat 5, XP SP3 and anything up.
installed using pressing Enter key to accept default options. I have run tomcat7.exe (without W) privileged to unblock network server functionality, i.e go to program directory, right click to run as administrator with service stopped, then ^C to exit, start service and works fine.

C:\Users\Gheist>netstat -an | find "8080"
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING
  TCP    [::]:8080              [::]:0                 LISTENING
C:\Users\Gheist>ver
Microsoft Windows [Version 6.1.7601] = Win 7 SP1
C:\Users\Gheist>java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing) Screenshot of working IPv6 website using Tomcat 7

Author

Commented:
I wish mine was doing what I see on yours but as you see below something is not correct.  I might try to install tomcat again and see what happens.  I do see where our Java is 64 bit where yours is 32 bit.  Any other thoughts.

C:\Users\administrator.STI>java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

C:\Users\administrator.STI>netstat -an | find "8080"
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:28080          0.0.0.0:0              LISTENING
  TCP    172.24.1.71:8080       10.1.5.17:36577        TIME_WAIT
  TCP    172.24.1.71:8080       10.1.5.17:36578        TIME_WAIT
  TCP    172.24.1.71:8080       172.24.1.81:11269      ESTABLISHED
  TCP    172.24.1.71:8080       172.24.1.81:11333      ESTABLISHED
  TCP    172.24.1.71:8080       172.24.1.81:23264      ESTABLISHED
  TCP    172.24.1.71:8080       172.24.1.81:24037      ESTABLISHED
  TCP    172.24.1.71:8080       172.24.1.81:29076      ESTABLISHED
  TCP    172.24.1.71:8080       172.24.1.81:31153      ESTABLISHED

C:\Users\administrator.STI>
Top Expert 2015

Commented:
can you confirm firewall exception?

Author

Commented:
I can ping the server remotely or from on the server itself.

C:\Users\administrator.STI>ping ::1

Pinging ::1 from ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms


 Firewall rule allowing trafficfirewall2.PNG
Top Expert 2015

Commented:
firewall seems good
maybe APR? It is largely not necessary as sun-oracle is a known app server distributor and works to polish their performance.
https://issues.apache.org/bugzilla/show_bug.cgi?id=43327 ?

Author

Commented:
I just had another thought.  I went to another win2008 server to test this and IPv6 was installed but I had to check it to activate it.  I wonder if ipv6 wasn't checked when you do the tomcat install if tomcat doesn't install the library's needed to support ipv6.  Any thoughts?  
Top Expert 2015

Commented:
No such thing. It relies on Java to make TCP listener

Author

Commented:
I played with this a little yesterday.  I guess there are a few ways to install Tomcat.  When the install was done originally we just downloaded the tomcat zip file and put it in place and then ran a program to create tomcat startup service.  Yesterday we downloaded the same version of Tomcat but in the *.exe format and then did a typical install.  Installing the 2nd traditional way the ipv6 part works.  So something is missing when you do the install with the zip file procedure vs doing the normal install.  Anyone know why this happens or more importantly know what is missing so we can add it install of reinstalling Tomcat?
Top Expert 2015

Commented:
http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_0/res/tomcat.nsi no rocket science in the installer.
only place to specify listener is server.xml

Author

Commented:
Sorry, I'm not sure I understand.  Here is my server.xml file.  Is there something missing from it or something in it stopping IPv6 from working?

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="28005" shutdown="SHUTDOWN">

  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">
 
    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->
   
   
    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 28080
    -->
    <Connector port="28080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="28443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="28080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="28443" />
    -->          
    <!-- Define a SSL HTTP/1.1 Connector on port 28443
         This connector uses the JSSE configuration, when using APR, the
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="28443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 28009 -->
    <Connector port="28009" protocol="AJP/1.3" redirectPort="28443" />


    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">        
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->        

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/> -->
             
<!-- Edit: Realm removed by Modalot ->

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" deployOnStartup="false"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->

      </Host>
    </Engine>
  </Service>
</Server>
Top Expert 2015

Commented:
<Engine name="Catalina" defaultHost="localhost">

is ::1 resolving by means of hosts file to localhost?

Author

Commented:
Yes, it is resolving my means of the c:\windows\systems32\drivers\etc\hosts file.  From the web server itself it pings the localhost without issue, as you can see.   Also this Catalina line you posted is the same in the server.xml file from both the working and non working versions of Tomcat installs.


C:\BOSWeb>ping ::1

Pinging ::1 from ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\BOSWeb>
Top Expert 2015

Commented:
exactly that is the problem: no mention calling localhost ::1...
deleting reference to "localhost" in this particular config line should help.

Author

Commented:
I will delete the ::1   localhost entry out of the hosts file tomorrow morning and let you know what happens.

Can the moderators please delete comment http:#35506786?
Top Expert 2015

Commented:
it should be in hosts file.
i am surprised that ping ::1 does not show localhost
i have no windows at hand this week.

Author

Commented:
I think were way off track here.  Please remember I installed tomcat with the *.exe tomcat file on the SAME server that the install of tomcat was done with the *.zip file and with the exe install of tomcat IPv6 works so it's something with the install process of tomcat not this hosts file.
Top Expert 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
We were off target and not making any progress.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.