无法从 Google Compute Engine VM(Windows Server 2012)访问 8080 端口上的 tomcat 服务器

Unable to access tomcat server on 8080 port from Google Compute Engine VM (Windows Server 2012)

我在 Google Compute Engine 下创建了虚拟机,并为服务器选择 Windows Server 2012 R2 作为 OS。我已经安装了 Tomcat 8,它在 8080 HTTP 端口上是 运行。我可以使用内部 IP 和本地主机在浏览器上本地访问 tomcat。但是我无法从本地计算机使用外部 IP 访问 tomcat。 如果可能,请帮助我。我的 tomcat tomcat 服务器配置文件如下。

这有两个常见问题:

  1. 您需要在 GCE's firewall 上打开端口 8080 才能从 GCE 外部访问它。

  2. 可能 Tomcat 只在本地主机上侦听。您可能需要将 HTTP Connector address attribute 设置为 0.0.0.0,以便 Tomcat 侦听所有地址。