Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Tomcat5.5 listens to IPV6 and IPV4

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "how Tomcat5.5 monitors IPV6 and IPV4". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how Tomcat5.5 listens to IPV6 and IPV4".

Tomcat is a core project of the Jakarta project of the Apache Software Foundation (Apache Software Foundation), which is jointly developed by Apache, Sun and other companies and individuals. With the participation and support of Sun, the Servlet and JSP specifications of * * are always reflected in Tomcat, and Tomcat 5 supports Servlet 2.4 and JSP 2.0 of * *. Because of its advanced technology, stable performance and free, Tomcat is deeply loved by Java enthusiasts and recognized by some software developers, and has become a popular Web application server.

1 description of phenomenon

At that time, two applications were built on the same machine: App 1 and App 2, using the same Tomcat5.5, but launched on different ports (8080 and 8088). It was found that the ports on which the two applications were listening were both listening, but it was strange that neither of them could be connected through telnet 127.0.0.1 port. The "8080" port in the following figure can be connected through telnet, but the "8088" port is not connected successfully through telnet, and a "unable to connect to the target port error" will be reported when connecting.

Looking at the difference between the two ports through the netstat command, it is found that port 8080 is bound to "0.0.0.0 8080", while port 8088 does not have such a binding, but directly binds to the address of IPV6. In this case, no matter how you access it, it will not help, as shown below:

2 solution

Locate the conf\ server.xml file in the tomcat5.5 directory:

Add address= "0.0.0.0". The modified content is as follows:

Later, after an in-depth understanding, we know that the root cause of this problem is that when Tomcat5.5 starts up, if the system supports IPV6, the default listening is the port of IPV6, resulting in inaccessibility through IPV4. Modify the configuration file to add address= "0.0.0.0" to ensure that tomcat5.5 starts listening on any port under the IPV4 protocol stack.

IPV4 protocol snooping any address should be configured: 0.0.0.0

IPV6 protocol listens for any address-winning configuration: 0VOUL0VOUL0VOUL0UL0VOULO

There will be no problem with PS:Tomcat6 and later versions. The default listener is the address port of IPV4.

The above is all the content of the article "how Tomcat5.5 monitors IPV6 and IPV4". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report