Local connection server

SSH [email protected]Copy the code

If the connection fails, the following page is displayed

The solution

  • Vim C:\Users\66/.ssh/known_hosts
  • Press DD to clear the content
  • Press Esc plus :wq to save and exit

Nginx configuration in the server

nginx

1. sudo yum install yum-utils 2. vim /etc/yum.repos.d/nginx.repo 3. Press I to edit and add the following content. Then press Esc and :wq to save the configuration and exit. [nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true [nginx-mainline] name=nginx mainline repo  baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/ gpgcheck=1 enabled=0 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true 4. sudo yum-config-manager --enable nginx-mainline 5. sudo yum install nginx 7. Run the command nginxCopy the code

The following figure shows the successful configuration

Upgrade the node in the server

Download the node package from the node official website

  • Upload the compressed package to the server. I uploaded it in /home on the server. In the home folder, unzip the node-v12.13.1-linux-x64.tar.xz file.
// Decompress the package tar -xvf node-v12.13.1-linux-x64.tar.xz // Delete the package rm -rf node-v12.13.1-linux-x64.tar.xzCopy the code
  • After the decompression is complete, establishing a soft connection becomes global.
Ln -s /home/node-v12.13.1-linux-x64/bin/npm /usr/local/bin/npm ln -s /home/node-v12.13.1-linux-x64/bin/node /usr/local/bin/nodeCopy the code
  • Check the version numbers of Node and NPM.
NPM -v # NPM version number node -v # Node version numberCopy the code

Use WinSCP to upload the project file

/ usr / share / nginx / html

Centos install MongoDB 4.0 using yum

  • Configure the MongoDB yum source
CD /etc/ymp.repos. d 2. Vim mongodb-org-4.0.repo [mongodb-org-4.0] name= mongodb Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/ gpgcheck = 1 enabled = 1 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.ascCopy the code
  • Install the mongo
1. yum -y install mongodb-org 2. Vim /etc/mongod. Conf bindIp: 172.0.0.1 change bindIp: 0.0.0.0Copy the code
  • Start the mongo
# service mongod start # Service mongod stop # Service mongod status #Copy the code
  • The firewall must be disabled for Internet access
CentOS 7.0 uses the iptables firewall by default. Disable firewall systemctl stop firewalld. Service # Disable firewall systemctl disable firewalld. Service # Disable firewalldCopy the code

Installation of yarn

  • Add yum source
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
Copy the code
  • The installation
yum install yarn
Copy the code
  • Check the version
yarn -v
Copy the code

pm2

PM2 is a node process management tool. It can be used to simplify many node application management tasks, such as performance monitoring, automatic restart, load balancing, and so on.

Installation: YARN Global add PM2

Common commands:

Start pm2 start < app. Js > stop pm2 stop app_name | app_id delete pm2 delete app_name | app_id restart pm2 restart app_name | pm2 app_id check process The list view logs pm2 logs app_name | app_idCopy the code

The vUE or React History route page is updated 404

  • cd /etc/nginx/conf.d
  • Vim default.conf (add code: try_files uriuri uriuri/ /index.html;)
  • Nginx: nginx -s reload

If the following error is reported

Conf file, run the nginx -c /etc/nginx/nginx.conf command, and then run nginx -s reload

Solutions:

  • View the port: netstat -ntlp

  • Kill a process: kill 6751