Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux system CentOS 7 configure Spring Boot runtime environment

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

A new Linux server bought from Aliyun is used to deploy SpringBoot applications. Due to the previous use of the Debian version, the environment configuration is different and cumbersome. This article mainly introduces the process of configuring SpringBoot environment under CentOS.

New user

Since there are only root users in the new machine, there will be some security problems if you use root users to perform various operations directly, so let's create users first.

Please refer to this article: create a new user

Install Oracle Java 8

Spring Boot is a Java-based framework, so we need to install Java 8 first.

Please refer to this article: install JDK 8

Install MySql5.7

Since it is a J2EE function, we must have a database, and we use MySQL5.7 here.

Please refer to this article: install MySQL5.7

Install Nginx

We need Nginx to perform the reverse proxy of the service (domain name / IP).

Please refer to this article: install Nginx

Install the Spring boot project to serve the system, and start automatically when the server starts.

When we deploy the Spring boot application, when the server restarts, we need our application to start with the system at the same time, so we need to register our application as a system service to achieve self-startup.

Please refer to this article: configure service implementation self-startup

Note:

The ExecStart in this article is a jar package made by Spring boot, and the following configuration should be added to the project's build.gradle so that the jar package can be executed on the command line.

Add: to the build.gradle of the project:

Version 1.x:

SpringBoot {executable = true}

Version 2.x:

BootJar {launchScript ()} more

At this point, the server environment is ready to run a basic Spring Boot J2EE project. If you need more detailed configuration, please refer to my other blogs.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report