在文档中,在您自己的服务器上运行meteor的过程是运行
meteor bundle bundle.tgz
然后提取这个tarball ..
tar -xzvf bundle.tgz
然后启动节点服务器
MONGO_URL=mongodb://localhost:27017/<dbname> PORT=<server_port> ROOT_URL=http://sub.example.com/ node bundle/main.js
我正在尝试永远使用以保持节点服务器,但是当我运行以下命令(特定模糊)时,永远进程不会返回,我必须按CTRL + C才能返回到命令行 - 非常不喜欢。
MONGO_URL=mongodb://localhost:27017/<dbname> PORT=<server_port> ROOT_URL=http://sub.example.com/ forever bundle/main.js
如果我附加一个&符号来在后台运行该进程,那么我会回到命令行,一切看起来都很好,但永远不会生成任何日志或pid文件,最终永久进程会死掉。
答案 0 :(得分:12)
这对我有用:
export MONGO_URL=mongodb://localhost:27017/<dbname>
export PORT=<server_port>
export ROOT_URL=http://sub.example.com/
forever start bundle/main.js
答案 1 :(得分:7)
这是我的启动脚本,从rc.local调用:
#/bin/sh
cd /home/nodeapp/
export MONGO_URL=mongodb://localhost:27017/nodeapp
export PORT=80
export ROOT_URL=http://$(hostname)/
export METEOR_SETTINGS=$(<settings.json)
forever start bundle/main.js
希望它有所帮助。
[]中
AURO