<> How will springboot Project deployment to server


I learned a lot during the epidemic , I've been very busy before. I don't have much time to blog , Today, I write a blog to teach you how Xiaobai wrote himself springboot Project deployment to server , Make it accessible to everyone .

First step : Purchase server

To deploy your project to the server , We must first have a server of our own , Here we recommend Alibaba cloud servers , Cheap and easy to use , of course , You can also use other servers if you have your own .

Enter alicloud console

If you have accessed ECS before , Then the used products will show the ECS ecs, If not, you can search in the upper search interface

Click instance

Click More , Security group configuration found , And click , Then click Configure rules

Open the corresponding port , Both in and out directions should be opened at the same time

Then save , The first step is completed

Step two : Open the pagoda panel

Enter your own ip number , Add after 8888, You can enter the pagoda panel , however , Such a picture will be displayed

We just need to xshell Or Alibaba cloud's own remote control input

Then install the following software in the software store

Then the second step is completed

Step 3 : hold springboot Project success jar package

First, set the database to sql Import file to desktop ( Not a desktop , Desktop is recommended here )

Modify the remarks of the configuration file database , hold localhost Change to your own ip address , Then type the project into jar package

be careful
1.controller Layer all RequestMapping It's better not to have an address written in such a "/", Otherwise, it is easy to make mistakes
2.mapper The table names in the file should be all lowercase
3. It is recommended to type all the table names or fields with the same name as the keyword for example type,name wait

Step 4 : Upload project

Click file , Find it on the right home folder , Create a new folder , We call it java

Beat yourself up jar package , You can also copy all your configuration files to your new one java Inside the folder

Upload database

be careful , As like as two peas, the name and password of the database are exactly the same as their own configuration files.

Step 5 : Upload project
Turn off the firewall
ystemctl disable firewalld.service
open xshell, Find the place where your project is published
for example cd home/java

Publish your own project , input :
nohup java -jar jar Package name .jar >/dev/null 2>&1 &
Then just enter your own ip number + Port number corresponding to your project , You can access your own project