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);
app.set('host','app.site.com');
var server = http.createServer(app);
server.listen(port,'64.143.255.122');//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: 64.143.255.122 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?

Thanks

Answers


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

Search




Leave an answer