nginx deployment project

nginx Introduction

Nginx is a lightweight Web server / reverse proxy server and e-mail (IMAP / POP3) proxy server, distributed under BSD-like agreement. It features occupy less memory, high concurrency, the ability to do concurrent nginx fact the same type of web server performance is better, mainland China use nginx web site users are: Baidu, Jingdong, Sina, Netease, Tencent, Taobao.
Load balancing, reverse proxy

Install nginx

yum install -y nginx
disposed boot
systemctl Start nginx.service
systemctl enable nginx.service
Nginx default port 80, port 80 is not turned on ECS example, the default and only 22 3389

Deploy your own web applications

Vue own projects run the following command packaged
cnpm / npm run build
cd /usr/share/nginx/html
in a server running the following code:
cd /etc/nginx
vi nginx.conf // 修改root选项

Need to restart the server configuration is complete

Command / sbin / nginx -s reload

ecs server installation node

Use nvm install multiple versions of the Node
NVM (the Node Manager Version) is Node.js version management software that allows you to easily switch between the various versions of Node.js. Personnel suitable for long-term development or done node node version update fast, fast switching node version of the scene.
Git clone to use the source code under the local ~ / .nvm directory and check for the latest version.
Git the install yum
Git clone https://github.com/cnpm/nvm.git ~ / ~ .nvm && CD / .nvm && Checkout Git Git = 0 --tags DESCRIBE --abbrev
activation NVM.
echo. "~ / .nvm / nvm.sh" >> / etc / Profile
Source / etc / Profile
lists all versions of Node.js.
nvm list-remote
mounting Node.js plurality of versions.
install v8.12.0 NVM
NVM install v10.15.0
run nvm ls View Node.js installed version, currently used version v7.4.0. Back results are shown below.
nvm ls
test node version
node -v
if you want to switch version
nvm use 8.12.0
local project to create an express
EJS --view = MyApp Express
CD / usr / local / the src
CD MyApp
NPM I
NPM RUN Start
must remember to configure the port 3000
http://47.103.82.2:3000

ECS installation mongodb

In the command waiting input terminal installation:
CD / usr / local
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.2.tgz
the tar-Linux-x86_64-3.6.2.tgz -zxvf MongoDB
MongoDB mkdir
CD / usr / local / MongoDB
mkdir Data
mkdir Data / DB
mkdir Data / logs
CD /usr/local/mongodb-linux-x86_64-3.6.2/bin
./mongod --dbpath = / usr / local / MongoDB / data / db --logpath = / usr / local / mongodb / data / logs / mongodb.log --fork

Guess you like

Origin www.cnblogs.com/wangjiahui/p/11359272.html