Tomcat can not access through their own IP, but can be accessed via localhost / 127.0.0.1

 

 

First, the problem is as follows: LAN, their machines deployed a tomcat application on this machine can by way of access to the referenced.

     http://localhost:8080/xxxx

    http://127.0.0.1:8080/xxxx

   If my machine's IP is 192.168.1.100, but not by accessing the following manner (IP):

  http://192.168.1.100:8080/xxxx found it impossible to access.

 

II. Solutions

    Case ① firewall / antivirus software problems, are closed 

    Case ②tomcat binding issues IP addresses, first by using cmd netstat -n command, see the tomcat address binding, it was found to bind to :: 1, IPv6.

      So we then bind to the native address IP4 can do the following:

      Configuring server.xml tomcat, the connector configuration change, do not change the port, with address = "0.0.0.0", it is bound to IPv4, as follows:

    <1> Use the cmd command netstat -n, see tomcat address binding, it was found to bind to :: 1, IPv6;
    <2> Configure server.xml tomcat, the connector configuration change, do not change the port, with address = "0.0.0.0", it is bound to IPv4
    <!-- A "Connector" represents an endpoint by which requests are received  and responses are returned. Documentation at :  Java HTTP Connector: /docs/config/http.html  Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html  Define a non-SSL/TLS HTTP/1.1 Connector on port 8080-->         
      <Connector Port = "8080" = Protocol "the HTTP / 1.1"    address = "0.0.0.0" connectionTimeout = "20000" the redirectPort = "8443" />   is added to red part

    Case ③IP address is adsafe agents such as proxy software, you can turn off the software - this situation is difficult to think of

 

 Transfer the contents of the article Solutions https://bbs.csdn.net/topics/391915128?page=1  

            https://blog.csdn.net/xinyue3054/article/details/7895166

                        

Guess you like

Origin www.cnblogs.com/12three/p/11127338.html