npm init -y
npm install request cheerio async cron debug mongoose express ejs iconv-lite -S
如果需要是否yes,yes,如果需要输入密码 Zfpx2017
ssh root@ip
ssh [email protected]
apt-get update
apt-get install npm
npm install n -g
n 7.5
apt-get install mongodb
apt-get install git
git clone https://github.com/zhufengnodejs/201703crawl.git
cd 201703crawl
npm install
cd tasks
node main.js
ctrl+c退出
cd ..
node server.js
然后就可以通过浏览器访问我们的服务器
因为我们希望我们的服务在后台运行
npm install pm2 -g
pm2 start server.js --name 'crawl'