我已将 phantomjs 设置为 Web 服务器,用于在 AWS EC 上进行抓取。我不知道如何通过putty永远运行phantoms脚本?对于 NodeJS 来说,有像 Forever 这样的 phantom 替代方案吗?
最佳答案
PM2是一个不错的选择。你可以看一下文档,它可以让你的程序崩溃时自动重启,并且有很多很酷的功能。
要使用 PM2 启动 PhantomJS 应用程序,命令为:
pm2 start app.js --interpreter phantomjs
该应用程序将独立于您的 SSH session 运行,因此您可以安全地退出 Putty 窗口。
关于node.js - AWS EC - 如何永久运行 phantomjs 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36446537/