Fabio T
Fabio T

Reputation: 11

ERR_CONNECTION_TIMED_OUT while reaching Tomcat

I have VM (Ubuntu 20.4, Tomcat9) running on Google Cloud that is connected through VPN IkeV2 to our LAN. I can't access the service through web browser via 10.x.x.x:8080, returning "Err_connection_timed_out" despite having installed and correctly configured it. If I connect via remote desktop to the VM, I can see the status page stating Tomcat is running fine. I opened all the necessary ports in the Google Cloud, but I cannot sort out this problem. What I am doing wrong?

Upvotes: 1

Views: 2246

Answers (1)

Priya Gaikwad
Priya Gaikwad

Reputation: 495

  • Confirm if port 8080 is configured on GCE's firewall and tomcat is listening on the correct port. Run the netstat command to check the listening port.

                           netstat -ntlp | grep LISTEN
    
  • Check if port 8080 is accessible from outside. Port could be blocked. Check your firewall settings and open the port for http request.

  • Also it could be that Tomcat is only listening on the localhost. You might need to set the HTTP-Connector address attribute to your IP address so that Tomcat listens on it. To make Tomcat listen on the 10.x.x.x address, add ‘address=10.x.x.x’ in the Connector string of the tomcat9/server.xml file and restart the tomcat server after changes are done. It looks something like:

                          <Connector port="8080" protocol="HTTP/1.1" 
                          maxHttpHeaderSize="65536" 
                          connectionTimeout="20000" 
                          redirectPort="8443" 
                          address="IP address" />
    
  • Confirm if you have enabled the "Allow HTTP traffic" checkbox in VM configuration.

Upvotes: 1

Related Questions