Home Ask Login Register

Developers Planet

Your answer is one click away!

SexyMF February 2016

NodeJs (Express) wont listen to the IP and host in ubuntu

I have deployed my app to ununtu.

this is the bin/www:

app.set('port', 3000);
var server = http.createServer(app);
server.listen(port,'');//I put here a fake IP (deployed with the real one)
server.on('error', onError);
server.on('listening', onListening);

I have created a host in my PC: app.site.com and I open the browser in: http://app.site.com:3000 and it does not work.

But, if I go via lynx, inside the server, and write lynx http://localhost:3000 it will work, I will get the correct page.

What might be the problem?



Avi Fatal February 2016

Did you make iptables to allow it?

try this:

iptables -A INPUT -p tcp --dport 3000 -j ACCEPT

Post Status

Asked in February 2016
Viewed 3,574 times
Voted 7
Answered 1 times


Leave an answer

Quote of the day: live life