I had the same problem. Found a node.js script that can run shell commands and use it to run the http-server command along with the parameters.
example node.js script named 'startserver.js':
var sys = require('sys') var exec = require('child_process').exec; function puts(error, stdout, stderr) { sys.puts(stdout) } exec("sudo http-server -a ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com -p 80", puts);
Then you can run it forever:
forever start startserver.js
source share