简体   繁体   English

在 Linux 的嵌入式 Tomcat 服务器中运行 Spring Boot 应用程序

[英]Running Spring Boot application in embedded Tomcat server in Linux

I am running Spring Boot application in embedded Tomcat server.我在嵌入式 Tomcat 服务器中运行 Spring Boot 应用程序。 I am placing the executable jar file with Tomcat server embedded in it in a path in Linux server, logging in to Linux environment using putty, navigating to the path where I have kept my jar file and running as我将嵌入了 Tomcat 服务器的可执行 jar 文件放置在 Linux 服务器的路径中,使用 putty 登录到 Linux 环境,导航到我保存 jar 文件的路径并作为

java -jar my-jar.jar

The problem is using this way the embedded tomcat server will stop and the jar file will stop running when putty is exited.问题是使用这种方式嵌入式tomcat服务器将停止并且jar文件将在退出putty时停止运行。 Can you suggest a way how to execute the executable jar file so that it keeps running in the Linux environment without stopping.您能否建议一种如何执行可执行 jar 文件的方法,使其在 Linux 环境中继续运行而不会停止。

One solution I found is to run the jar as a service of Linux.我发现的一个解决方案是将 jar 作为 Linux 服务运行。 Is there any other way of doing this?有没有其他方法可以做到这一点?

You can start it as background process:您可以将其作为后台进程启动:

java -jar my-jar.jar &

But the Linux service is the better way.但是 Linux 服务是更好的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM