fedwiki / wiki-server

Federated Wiki client and server in Node.js
Other
153 stars 35 forks source link

How to run wiki as a daemon and keep it alive #104

Closed acorbi closed 8 years ago

acorbi commented 8 years ago

I have installed FedWiki on my server using npm install -g wiki and can run it without problems by typing wiki -p PORT_OF_CHOICE

However, I would like to use https://github.com/nodejitsu/forever for ensuring that the process is alive all the time, as I do with other nodejs apps. Forever expects a js file as parameter which should start the daemon. I noticed that index.js references coffee-script files and the gruntfile manages testing but...

How can I run the wiki in a nodejs fashion (node jsfile.js)? Can you please provide some instructions on how to achieve this? Alternatively, How would you deploy FedWiki on a server?

nrn commented 8 years ago

The file that actually gets run when you type wiki on the command line is: https://github.com/fedwiki/wiki-node/blob/master/index.js from the wiki-node repo. That should work with forever, but i'm not sure how to pass command line flags to it using forever, you probably have to use a config.json file, or environment variables prefixed with wiki_, like wiki_port to set options you'd like.

I usually use the systems process monitor to deamonize my node processes (often upstart on ubuntu), but it requires some background research and learning a new config language. If you've got a setup you like with forever i'd encourage you to push forward with it, and let us know how it works out!

acorbi commented 8 years ago

@nrn thanks! Cloning and deploying wiki-node instead of wiki-node-server does it. Then I just can run it with forever start index.js