尝试使用request.getRemoteAddr()时获得ipv6地址:0.0.0.0.0.0.0.1的解决方法
2016-01-15 22:51
477 查看
如果tomcat运行在IPV6启用的服务器环境中,比如windows server 2008,如果用IPV4的地址去访问8080端口,连接将会失败。即使在hosts文件中配置了::
localhost127.0.0.1
localhost也是没有效果的。因为这是tomcat的问题,我们需要在tomcat目录下,将server.xml中的address指定为使用IPV4,详细配置可以参考如下I
found that there was a bug with Tomcat 5 running on Windows server 2008 64 bit. It attempts to use IPv6 over the default IPv4.To
resolve it, open up the Server.xml file and search for "<Connector". The top Connector will have the port that you're trying to communicate through, in my case 8080. In between port="8080" maxHttpHeaderSize="8192" type address="0.0.0.0" (Line will look likeport="8080"
address="0.0.0.0" maxHttpHeaderSize="8192").Restart
Tomcat and you should be good to go.即在端口配置项中,添加address="0.0.0.0"
localhost127.0.0.1
localhost也是没有效果的。因为这是tomcat的问题,我们需要在tomcat目录下,将server.xml中的address指定为使用IPV4,详细配置可以参考如下I
found that there was a bug with Tomcat 5 running on Windows server 2008 64 bit. It attempts to use IPv6 over the default IPv4.To
resolve it, open up the Server.xml file and search for "<Connector". The top Connector will have the port that you're trying to communicate through, in my case 8080. In between port="8080" maxHttpHeaderSize="8192" type address="0.0.0.0" (Line will look likeport="8080"
address="0.0.0.0" maxHttpHeaderSize="8192").Restart
Tomcat and you should be good to go.即在端口配置项中,添加address="0.0.0.0"
相关文章推荐
- mongoVUE1.5完全破解版赠送
- UI_Label标签属性
- Implement Stack using Queues leetcode
- UI_2
- UI_1
- UI_视图界面
- String、StringBuffer和StringBuilder的区别
- 自定义视图与工厂模式
- IOS动画中的枚举UIViewAnimationOptions
- Android界面设计的4种方式之二——在Java代码中控制UI界面
- 【leetcode】100. Same Tree My Submissions Question
- query specified join fetching, but the owner of the fetched association was not present in the select list
- Android开发出现Warning:Gradle version 2.10 is required. Current version is 2.8. If u
- 【Codeforces 570D 】Tree Requests dfs序+二分
- iOS 【关于几个常用UIColor宏定义】
- Animation动画详解(四)——ValueAnimator基本使用
- 【UEditor】百度UE富文本自定义按钮添加文本
- Android UI之ImageSwitcher && TextSwitcher 实现图文翻页
- Django+Query
- Dissecting Message Queues(不同消息中间件Throughput和latency