得到蜘蛛:由于许可被拒绝,幻影失败了

时间:2013-03-12 18:44:06

标签: meteor

我捆绑了我的应用程序并将其放到我的服务器上。我通过暴发户运行应用程序:

exec sudo -u myuser PORT=3005 MONGO_URL=mongodb://localhost:27017/ms ROOT_URL=http://www.example.com/ /usr/bin/node /var/www/priv/example.com/bundle/main.js >> $

重要的部分(我认为)是:

exec sudo -u myuser

当我通过以下方式卷曲我的应用程序时:

curl http://www.example.com/?_escaped_fragment_=

我得到一个空身。我的日志文件说:

spiderable: phantomjs failed: { [Error: Command failed: /bin/bash: /root/.bashrc: Permission denied
Can't open '/dev/stdin'
] killed: false, code: 255, signal: null }
stderr: /bin/bash: /root/.bashrc: Permission denied
Can't open '/dev/stdin'

我在/root/.bashrc上做了chmod 777但没有任何成功。如果我/bin/bash /root/.bashrc为'myuser',我也会被拒绝。

有没有人能告诉我如何设置权限,以便phantomjs可以做它必须做的事情?我可以指定〜/ .bashrc在任何地方使用吗?我真的很想在谷歌上看到我的东西: - )

非常感谢! 曼努埃尔

更新

我通过npm安装了phantom.js 1.8.2。 以root身份运行应用程序没有帮助。那么错误是:

spiderable: phantomjs failed: { [Error: Command failed: Can't open '/dev/stdin' ] killed: false, code: 255, signal: null } stderr: Can't open '/dev/stdin'

我发现,它似乎是导致问题的包。我在这里开了一个发布: github.com/alanning/meteor-roles/issues/3

2 个答案:

答案 0 :(得分:1)

Alanning解决了这个问题,但是蜘蛛侠仍然无法解决问题。解决方案是删除phantomjs,因为我通过npm安装它。然后我直接从http://phantomjs.org/download.html重新安装它。现在它正在运作!

答案 1 :(得分:-1)

我再次发现了这个问题,问题是服务器端的出版物在某些情况下刚刚返回,但没有停止订阅。

e.g。在服务器上我有一个

的出版物
return unless @userId

正确的方法是:

return this.stop() unless @userId

如果爬虫来了,它将永远不会被验证,所以要小心正确地结束出版物。