连接服务器

1.打开cmd命令行窗口
2.输入cd ~/.ssh,进入c盘下的.ssh文件
3.输入“ssh root@远程服务器的ip地址”连接远程服务器,

$ ssh root@121.196.245.102

https://blog.csdn.net/weixin_30955617/article/details/101634141
https://zhuanlan.zhihu.com/p/113270502

  1. 账号 root
  2. 密码 老密码
  3. cd / 到根目录
  4. ls 查看
  5. mkdir 创建目录
  6. pwd 查看绝对路径

安装nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

https://segmentfault.com/a/1190000021524481

安装node

nvm install node

安装pm2

npm i pm2 -g

安装 nginx

yum -y install nginx

切换路径

cd /etc/
ls 查看路径
cd nginx

配置反向代理

cd /etc/
ls 查看路径
cd nginx
cd conf.d
nano 指定的配置.con.conf
编辑
ctl+x 退出编辑

配置nginx.conf

nano nginx.conf

windows +s (或x) 离开

如果你正在使用nano使用_Ctrl+X来退出_编辑器。

server {
  listen 80;
  server_name jsppapi.jsplusplus.com;
  access_log /www/log/jsppapi/access.log;
  error_log /www/log/jsppapi/error.log;

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-Nginx-Proxy true;
    proxy_pass http://127.0.0.1:3002;
    proxy_redirect off;
  }
}
pm2 deploy deploy.config.js production setup