Linux 查看端口占用情况
// 查询端口占用
lsof -i:端口号
// 杀端口 (PID:进程号)
kill -9 PID
Nginx 端口转发
server {
listen 80;
server_name www.123.com;
location / {
proxy_pass http://127.0.0.1:8080;
index index.html index.htm index.jsp;
}
}
配置nohup
1,查询nohup位置:
which nohup
2,修改环境变量
vi .bash_profile
后台启动npm 服务
nohup npm run start > test.log & exit
or
nohup yarn start > test.log & exit
(注:exit较为关键,断开连接)
查看node后台相关进程
ps -ef | grep node