Linux 查看端口占用情况

  1. // 查询端口占用
  2. lsof -i:端口号
  3. // 杀端口 (PID:进程号)
  4. kill -9 PID

Nginx 端口转发

  1. server {
  2. listen 80;
  3. server_name www.123.com;
  4. location / {
  5. proxy_pass http://127.0.0.1:8080;
  6. index index.html index.htm index.jsp;
  7. }
  8. }

配置nohup

  1. 1,查询nohup位置:
  2. which nohup
  3. 2,修改环境变量
  4. vi .bash_profile

后台启动npm 服务

  1. nohup npm run start > test.log & exit
  2. or
  3. nohup yarn start > test.log & exit
  4. (注:exit较为关键,断开连接)

查看node后台相关进程

  1. ps -ef | grep node