Skip to content

Instantly share code, notes, and snippets.

View overra's full-sized avatar
😀

Adam Snodgrass overra

😀
View GitHub Profile

FreeBSD 10 Nodejs setup with nginx, mongodb, redis and monit

This my receipe for installing a complete nodejs server on FreeBSD 10. The parameters used in this configuration are for a very small private server that I use for demo purpose only, so for a production server, you should somehow set the limits in pair with your ressources.

I use monit so I don't have to write rc scripts for node and it should take care of process lifecycle management for me. Alternatives exists such as supervisord or circus.

Installing mongodb

for (var i = 0; i < states.length; i++) {
var state = states[i];
var theBlob = "";
stateEvents[state.Abbr] = (function (state, i) {
return function (event, data) {
for(var key in state) {
var attrName = key;
var attrValue = state[key];
theBlob += attrName + ': ' + attrValue + '<br>';
}