-
Notifications
You must be signed in to change notification settings - Fork 15
Notes on legal server
In order to keep the server up and running at all times, we added a file, /etc/init/nodeserver.conf
, that looks like
start on net-device-up
stop on shutdown
respawn
setuid casereveal
chdir /home/casereveal/casereveal
exec nodejs server.js
If for some reason the server process dies, this will automatically respawn it.
However, there are times when you don't want this behavior (e.g., when testing from a different user account), so it can be stopped by
$ sudo initctl stop nodeserver
and resumed by
$ sudo initctl start nodeserver
The node script listens on an internal port that is different than the default http port for web traffic. This port forwarding can be done with the iptables
command. The relevant rule is
$ sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports <internal port>
where <internal port>
is the port the server is listening on. There are plenty of instructions online for setting up this mapping.
Error: Cannot find module '../build/Release/bson'
change line in the catch block of node_modules\mongodb\node_modules\bson\ext\index.js
Change: bson = require(‘../build/Release/bson’);
To: bson = require(‘../browser_build/bson’);
Use homebrew to install zmq: brew install zmq