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

Some suggestions on Vue code readability

Table of contents 1. Make good use of components ...

Various types of MySQL indexes

What is an index? An index is a data structure th...

HTML markup language - table tag

Click here to return to the 123WORDPRESS.COM HTML ...

Teach you how to build Tencent Cloud Server (graphic tutorial)

This article was originally written by blogger We...

40 web page designs with super large fonts

Today's web designs tend to display very larg...

jQuery realizes the shuttle box function

This article example shares the specific code of ...

IE6 web page creation reference IE6 default style

This is not actually an official document of IE. I...

What is BFC? How to clear floats using CSS pseudo elements

BFC Concept: The block formatting context is an i...

MySQL table name case selection

Table of contents 1. Parameters that determine ca...

Summary of MySQL logical backup and recovery testing

Table of contents 1. What kind of backup is a dat...

How to implement data persistence using the vuex third-party package

Purpose: Allow the state data managed in vuex to ...