https://ecs.console.aliyun.com
更新安装源
apt-get update
https://nodejs.org/en/download/package-manager
apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
apt-get install nodejs
apt-get install mysql-server
apt-get install mysql-client
apt-get install libmysqlclient-dev
强大的进程管理器,进程异常退出时pm2会尝试重启
npm install pm2 -g
命令 | 用途 |
---|---|
pm2 start app.js --name "crawl" | 启动应用 |
pm2 list | 查看所有应用 |
pm2 restart crawl | 重启应用 |
pm2 stop crawl | 停止应用 |
pm2 delete crawl | 删除应用 |
Nginx是一个高性能的HTTP
和反向代理
服务器
apt-get install nginx
nginx -c /etc/nginx/nginx.conf
nginx -s stop
nginx -s reload
kill -HUP nginx
service nginx {start|stop|status|restart|reload|configtest|}
upstream crawl{
ip_hash;
server 127.0.0.1:3000 weight=10;
server 127.0.0.1:4000 weight=1;
}
server {
listen 80;
server_name www.zfpx.com;
location / {
proxy_pass http://crawl;
}
}