春季靴子和Tomcat从外面访问

发布于 2025-01-31 11:28:06 字数 1498 浏览 1 评论 0原文

几天来,我一直在尝试通过在Stackoverflow和其他网站上搜索来解决这个问题,但我找不到它。

我目前有一个Spring Boot应用程序转换为服务器上运行的JAR。使用直接集成到我的Spring Boot应用程序的tomcat,使用端口8080上的Localhost访问该应用程序。

问题是:

我们将在这里告诉我服务器的IP地址为123.45.69.894

如果我输入:

localhost:8080/mypath

或者如果我输入:

123.45.69.894:8080/mypath

在服务器的浏览器中。当我提出请求时,我有在控制台中出现的:

2022-05-21 08:23:26.094  INFO 7536 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-05-21 08:23:26.094  INFO 7536 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-05-21 08:23:26.109  INFO 7536 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 15 ms

一切正常。

但是,如果我键入,则

123.45.69.894:8080/mypath

在另一台计算机的浏览器中不再起作用,并且我有一个连接超时错误,并且控制台中没有任何内容。

我已经检查了防火墙是否没有阻止端口8080。但是问题不存在。

我还在港口80和IIS网站上,问题可能来自那里吗?

例如,我已经看过这些文章,但这对我不起作用:

如何在IIS中部署Spring Boot应用程序

apache tomcat

有人知道问题可能来自哪里以及如何解决问题吗?

For a few days I've been trying to solve this problem by searching on stackoverflow and other sites but I can't find it.

I currently have a spring boot application converted to jar running on a server. This application is accessible via a browser using the localhost on port 8080 by using tomcat which was directly integrated to my spring boot application.

The problem is the following:

We will tell here that the ip address of my server is 123.45.69.894

If I type :

localhost:8080/mypath

or if I type :

123.45.69.894:8080/mypath

in the browser of the server. I have this that appears in the console when I make the request :

2022-05-21 08:23:26.094  INFO 7536 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-05-21 08:23:26.094  INFO 7536 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-05-21 08:23:26.109  INFO 7536 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 15 ms

and everything works well.

But if I type,

123.45.69.894:8080/mypath

in the browser of another computer it doesn't work anymore and I have a connection time out error and nothing appears in the console.

I have already checked if the firewall doesn't blocked the port 8080. But the problem is not there.

I have also on the port 80 an IIS web site, the problem can come from there ?

I have already looked at these articles for example but that doesn't work for me :

how to deploy Spring boot application in IIS

Apache Tomcat not accessible from outside

Does anyone know where the problem might come from and how to solve it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无语# 2025-02-07 11:28:06

从远程计算机中,尝试使用您的IP地址。如果有时,机器之间肯定存在防火墙问题。
如果Ping有效,请尝试使用Telnet IP端口。如果在Windows上,您可能需要从设置/应用程序中启用Telnet。如果telnet连接,
直到您击中CNTRL方形支架,才不会采取任何措施。如果有效,那么一切都可以正常工作。

From the remote machine, try pinging your IP address. If it times out there is definitely a firewall issue between the machines.
If ping works, try telnet IP port. If on Windows you may need to enable telnet from setup/applications. If telnet connects, the
there will be no action until you hit cntrl square bracket. If that works then everything should work ok.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文