CentOS 7.2 builds nginx web server to deploy uniapp project

CentOS 7.2 builds nginx web server to deploy uniapp project

Panther started as a rookie, and I am still a rookie now, but I learn from the people and share what I have learned with you from time to time. In the last blog, I talked about the multi-device co-display of thingsboard. Because I am in the learning stage now, I have come into contact with many things and they are also quite complicated. I hope my article can provide you with a little help.

oneBuy Tencent Cloud

https://cloud.tencent.com/

Products – Cloud Server – Buy Now – Quick Configuration – Region – Entry Level Configuration – CentOS 7.2 – Buy

insert image description here

Example console https://console.cloud.tencent.com/cvm

insert image description here

Modify the security group open port

insert image description here

Because all ports can be connected at the beginning, change it to the specified port connection here

insert image description here

Reset Password

insert image description hereinsert image description hereinsert image description hereinsert image description here

**two ** Connect through tools – xshell

Host name--Fill in the host name you purchased 123.175.167.214
Username root
Password: Email address Port: 22 

insert image description here

Upload nginx to the home folder of centos

insert image description here

Connect to centos through xshell and enter the command to enter the root directory cd /
View all catalogsll
Enter the home directory cd home/
ll

Install nginx When nginx is not installed, visit 123.175.167.214

insert image description here

Unzip nginx in the home directory in xshell
tar -zxvf nginx-1.12.0.tar.gz
To build an environment for using nginx, use yum -y install gcc-c++
yum -y install pcre-devel
yum -y install zlib-devel
yum -y install openssl openssl-devel
After the environment is installed, enter the nginx folder ll
cd nginx-1.12.0/
Compile nginx, there is no space here./configure
make
make install
Installation successful /usr/local/nginx 

insert image description here

Enter the directory where the installation was successful cd /usr/local/
ll
cd /usr/local/nginx/
ll 

insert image description here

View current location pwd
Start nginx
cd sbin/
ll
./nginx 

insert image description hereinsert image description here

three
Deploy uniapp
Create a new file movie in the /usr/local/nginx/directory of centos
Put all h5 pages under movie 

insert image description here

Configure the published address to nginx,
Check if the file was uploaded successfully!
cd /usr/local/nginx/
ll
cd movie/
ll
cd h5/
ll
Return to cd /usr/local/nginx/ again
Because all configurations are in conf under nginx
cd conf/
ll
Find the nginx.conf configuration file and modify it vim nginx.conf 

insert image description here

Enter the sbin directory and run cd ..
cd sbin/
Run the test ./nginx -t
Restart the server ./nginx -s reload
Test OK, test successful 

insert image description here

**four ** The purchase of Tencent Cloud, the construction of the web server, and the h5 deployment of uniapp are now complete

insert image description here

Summarize

The above is what I introduced to you about deploying the uniapp project on the nginx web server on centos7.2. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • uniapp, Issues with using MQTT in WeChat applets
  • Based on vue+uniapp live broadcast project, uni-app imitates Douyin/Momo live broadcast room function
  • How to use mqtt in uniapp project

<<:  In-depth explanation of the maximum value of int in MySQL

>>:  The whole process record of introducing Vant framework into WeChat applet

Recommend

Detailed steps for installing and configuring MySQL 8.0 on CentOS

Preface Here are the steps to install and configu...

Summary of the top ten problems of MySQL index failure

Table of contents background 1. The query conditi...

Analysis and Solution of ERROR:2002 Reported When MySQL Starts

Preface This article mainly introduces the analys...

MySQL stored functions detailed introduction

Table of contents 1. Create a stored function 2. ...

Detailed explanation of various usages of proxy_pass in nginx

Table of contents Proxy forwarding rules The firs...

Weather icon animation effect implemented by CSS3

Achieve results Implementation Code html <div ...

Summary of event handling in Vue.js front-end framework

1. v-on event monitoring To listen to DOM events,...

How many ports can a Linux server open at most?

Table of contents Port-related concepts: Relation...

Creative About Us Web Page Design

Unique “About”-Pages A great way to distinguish yo...

Ideas and methods for incremental backup of MySQL database

To perform incremental backup of the MySQL databa...

Detailed explanation of JavaScript function introduction

Table of contents Function Introduction function ...

How to implement responsive layout in vue-cli

When we are doing front-end development, we will ...

Vue components dynamic components detailed explanation

Table of contents Summarize Summarize When the ar...

8 essential JavaScript code snippets for your project

Table of contents 1. Get the file extension 2. Co...