免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1715 | 回复: 0
打印 上一主题 下一主题

急呀,急呀!!Tomcat 如何支持IPV6请教下各位大侠 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-03-27 17:45 |只看该作者 |倒序浏览
大家好,现在有个问题,要请教大家
我的操作系统是:Linux RedHat as 5,该主机上有一块网卡,配置了两个IP地址
ipv4:192.168.1.1
ipv6:fe0c::1
在同一局域网内,有另外一个主机(win2003),同样是一块网卡,2个地址
ipv4:192.168.1.2
ipv6:fe0c::2

这两个主机可以互通
ping 192.168.1.1
ping -6 fe0c::1
都可以平通

我在linux主机上,构建了一个tomcat环境,配置如下
  1. <?xml version='1.0' encoding='utf-8'?>
  2. <!--
  3.   Licensed to the Apache Software Foundation (ASF) under one or more
  4.   contributor license agreements.  See the NOTICE file distributed with
  5.   this work for additional information regarding copyright ownership.
  6.   The ASF licenses this file to You under the Apache License, Version 2.0
  7.   (the "License"); you may not use this file except in compliance with
  8.   the License.  You may obtain a copy of the License at

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

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

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

  30.   <!-- Global JNDI resources
  31.        Documentation at /docs/jndi-resources-howto.html
  32.   -->
  33.   <GlobalNamingResources>
  34.     <!-- Editable user database that can also be used by
  35.          UserDatabaseRealm to authenticate users
  36.     -->
  37.     <Resource name="UserDatabase" auth="Container"
  38.               type="org.apache.catalina.UserDatabase"
  39.               description="User database that can be updated and saved"
  40.               factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
  41.               pathname="conf/tomcat-users.xml" />
  42.   </GlobalNamingResources>

  43.   <!-- A "Service" is a collection of one or more "Connectors" that share
  44.        a single "Container" Note:  A "Service" is not itself a "Container",
  45.        so you may not define subcomponents such as "Valves" at this level.
  46.        Documentation at /docs/config/service.html
  47.    -->
  48.   <Service name="Catalina">
  49.   
  50.     <!--The connectors can use a shared executor, you can define one or more named thread pools-->
  51.     <!--
  52.     <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
  53.         maxThreads="150" minSpareThreads="4"/>
  54.     -->
  55.    
  56.    
  57.     <!-- A "Connector" represents an endpoint by which requests are received
  58.          and responses are returned. Documentation at :
  59.          Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
  60.          Java AJP  Connector: /docs/config/ajp.html
  61.          APR (HTTP/AJP) Connector: /docs/apr.html
  62.          Define a non-SSL HTTP/1.1 Connector on port 8080
  63.     -->
  64.     <Connector port="80" protocol="HTTP/1.1"
  65.                connectionTimeout="20000"
  66.                redirectPort="8443" />
  67.     <!-- A "Connector" using the shared thread pool-->
  68.     <!--
  69.     <Connector executor="tomcatThreadPool"
  70.                port="8080" protocol="HTTP/1.1"
  71.                connectionTimeout="20000"
  72.                redirectPort="8443" />
  73.     -->           
  74.     <!-- Define a SSL HTTP/1.1 Connector on port 8443
  75.          This connector uses the JSSE configuration, when using APR, the
  76.          connector should be using the OpenSSL style configuration
  77.          described in the APR documentation -->
  78.     <!--
  79.     <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
  80.                maxThreads="150" scheme="https" secure="true"
  81.                clientAuth="false" sslProtocol="TLS" />
  82.     -->

  83.     <!-- Define an AJP 1.3 Connector on port 8009 -->
  84.     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


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

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

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

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

  106.       <!-- This Realm uses the UserDatabase configured in the global JNDI
  107.            resources under the key "UserDatabase".  Any edits
  108.            that are performed against this UserDatabase are immediately
  109.            available for use by the Realm.  -->
  110.       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
  111.              resourceName="UserDatabase"/>

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

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

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

  129.       </Host>
  130.     </Engine>
  131.   </Service>
  132. </Server>
复制代码
启动成功后,查看端口
netstat -apn | grep 80
是没有问题的,
在windows主机上,通过ipv4访问,可以成功
但是,通过ipv6访问,就无法成功
http://[fe0c::1]
这事为什么呀,,,,,求大神解答呀
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP