In the docs the procedure to run meteor on your own server is to run
meteor bundle bundle.tgz
Then extract this tarball..
tar -xzvf bundle.tgz
Then start a node server
MONGO_URL=mongodb://localhost:27017/<dbname> PORT=<server_port> ROOT_URL=http://sub.example.com/ node bundle/main.js
I'm trying to use forever to keep the node server up, but when I run the following command (specifics obscured), the forever process doesn't return and I have to CTRL+C to get back to the command line - very unforever like.
MONGO_URL=mongodb://localhost:27017/<dbname> PORT=<server_port> ROOT_URL=http://sub.example.com/ forever bundle/main.js
If I append an ampersand to run the process in the background then I get back to the command line and everything looks fine, but forever doesn't generate any logs or pid files and eventually the forever process dies.
This works for me:
export MONGO_URL=mongodb://localhost:27017/<dbname>
export PORT=<server_port>
export ROOT_URL=http://sub.example.com/
forever start bundle/main.js
This is my startup script, called from 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
Hope it helps someone.
[]s
Auro
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With