I am trying to run nodejs server on amazon micro instance for the past 3-4 days with no success.
i followed so many tutorials and i cannot make the server work (so when its visited in browser or curl in powerShell and see the simple hello world).
Here are the last 3 tutorials I've tried:
http://iconof.com/blog/how-to-install-setup-node-js-on-amazon-aws-ec2-complete-guide/ http://techprd.com/setup-node-js-web-server-on-amazon-ec2/ http://devblog.daniel.gs/2014/01/deploying-node-apps-on-aws-ec2-with.html
I've tried ubuntu/ amazon linux.
I've also followed http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html just to see how the general process works and it did work fine.
I get to the point where i do something like: sudo node filename.js
and the server runs.
However when i try visiting or curl it. it doesnt work. when i ping it it pings fine.
in amazon i set the security group to basically allow everything like so:

in linux its self i followed : https://help.ubuntu.com/community/IptablesHowTo?action=show&redirect=Iptables to open the port i was trying to listen to and nothing.
when i type : sudo service iptables status i get :
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:1337:1347
2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:1338:1348
3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:10000
keep in mind i am not a server savvy guy.
Any help would be highly appreciated.
UPDATE: To start my node server i use the basic code found in nodejs.org :
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
This is exactly how my file look like
in amazon i set the security to basically allow everything? What are the settings of the security group applied to that instance? - hanleyhansen