Bi Set Summary 02 Web Terminal-A brief introduction to the project, SpringBoot project deployment to Alibaba Cloud

Article Directory

series

Bishe Summary 01 Overview-"Smart Campus Small Business Circle"
Bishe Summary 02 Web Terminal-A brief introduction to the project, SpringBoot project deployment to Alibaba Cloud


1. Brief introduction

General technology : SpringBoot, Layui mini, Mybatiis-Plus, Shiro, Qiniu cloud storage. At the same time, the project is deployed on Alibaba Cloud and can be accessed using a domain name.

Architecture diagram

Main function : It is mainly to use Layui's data table function to visually display database tables, and to add, delete, modify and check tables. Secondly, the web can set the carousel URL of the App, and send announcements to the App and view the feedback of App users.

Unnamed file

Dependencies used:

pom.xml

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Fastjson -->
<dependency>
  <groupId>com.alibaba</groupId>
  <artifactId>fastjson</artifactId>
  <version>1.2.76</version>
</dependency>
<!-- Thymeleaf(视图解析和公告表格用到了) -->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- Shiro -->
<dependency>
  <groupId>org.apache.shiro</groupId>
  <artifactId>shiro-spring</artifactId>
  <version>1.7.1</version>
</dependency>
<!-- Thymeleaf扩展Shiro(其实没用到)-->
<dependency>
  <groupId>com.github.theborakompanioni</groupId>
  <artifactId>thymeleaf-extras-shiro</artifactId>
  <version>2.0.0</version>
</dependency>
<!-- MySQL 驱动 -->
<dependency>
  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- MyBatis-plus -->
<dependency>
  <groupId>com.baomidou</groupId>
  <artifactId>mybatis-plus-boot-starter</artifactId>
  <version>3.4.2</version>
</dependency>
<!-- Lombok -->
<dependency>
  <groupId>org.projectlombok</groupId>
  <artifactId>lombok</artifactId>
  <version>1.18.12</version>
</dependency>
<!-- 七牛云存储 -->
<dependency>
  <groupId>com.qiniu</groupId>
  <artifactId>qiniu-java-sdk</artifactId>
  <version>[7.5.0, 7.5.99]</version>
</dependency>
<!-- Swagger文档交互 -->
<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger2</artifactId>
  <version>2.9.2</version>
</dependency>
<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger-ui</artifactId>
  <version>2.9.2</version>
</dependency>
<!--热部署-->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-devtools</artifactId>
  <optional>true</optional>
</dependency>
<!-- 测试 -->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-test</artifactId>
  <scope>test</scope>
  <exclusions>
    <exclusion>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
    </exclusion>
  </exclusions>
</dependency>

2. Project deployment

Usually I will deploy the project on the cloud and add a domain name of my own, so that I can explain it to the teacher.

1. Purchase a server

This step is written in another blog of mine, so I will skip it here. Deploy MySQL database to the server

I also bought a domain name on Alibaba Cloud, and then I can directly access the website through the domain name. Here is a brief explanation.

First choose a domain name of your choice: URL

After choosing a personal purchase, go to the domain name console of Alibaba Cloud and select resolution.

image-20210606164659485

Add record (usually the default is used, but it will be used to configure Qiniu Cloud later)

image-20210606164848792

2. Install the pagoda

This step is actually similar to that blog, but it’s important to write about it.

If you have purchased Alibaba Cloud CentOS, connect to the server inputyum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

Log in to the pagoda panel and installOne-click deployment of Java projects, Open on the far rightHome page display, Easy to find next time.

image-20210606163355582

3. Project packaging

Project packaging in IDEA (I am a Spring Boot project, other projects are Baidu by their own)

image-20210606163607096
image-20210606163811951

Note: the packaging may fail, just clean it up and repack it, try a few more times

image-20210606163715433

4. Upload the project

  • After the SpringBoot project is packaged, it is a jar package
image-20210606164057826

Choose to upload files in the pagoda

image-20210606164207413

5. Deploy the project

One-click deployment using Java projects:

image-20210606165501720

What it looks like after successful deployment:

image-20210606165624414

Then you can passDomain name: port numberTo access the website in the form of, we obviously don’t want to enter the port number every time, so we need to map it below.

image-20210606174338308

Click the mapping on the project side, it will automatically go to the website to add oneDomain name: 80, We then manually add a www.domain name:80. (Mapping needs to install Apache first, just go to the software store to install it)

Install Apache

image-20210606175336396

Add mapping

image-20210606175034931

add manully

image-20210606175244990

After access, you only need to enter the domain name

image-20210606175437430