我正尝试从Parallels Desktop访问我的本地主机服务器,但遇到一些问题。
例如,我在Spring Boot上有一个应用程序,它在端口8081上运行,在终端中运行sudo lsof -PiTCP -sTCP:LISTEN会得到以下输出:
java 8168 username 107u IPv6 0x53524f3d71f26ae5 0t0 TCP *:8081 (LISTEN)
第二个应用程序(不是Spring Boot,而是Tomcat 7中的Spring )的输出是:
java 7756 username 504u IPv6 0x53524f3d6cfe6fa5 0t0 TCP localhost:8096 (LISTEN)
我可以通过address http://10.211.55.2:8081/轻松访问Parallels Desktop中的第一个应用程序,但对http://10.211.55.2:8096/执行相同操作时会出现此站点无法访问的错误信息。
那么,如何在*:8096而不是localhost:8096上运行我的第二个应用程序呢?
发布于 2020-08-15 19:01:59
tomcat监听的IP地址由tomcat配置文件server.xml中的address attribute in the connector element控制。
要监听所有地址,请将地址设置为0.0.0.0
<Connector port="8096"
address="0.0.0.0"
...other attributes.../>https://stackoverflow.com/questions/63421286
复制相似问题