Nodejs newbie, I bought an Alibaba Cloud server with the lowest configuration. I want to deploy the nodejs project I wrote. The node version is 6.10.0.
But an error is reported during startup
Port number: 3000
ip is the public IP of Alibaba Cloud
Port usage 3000 is not in use:
Baidu tried many methods but couldn’t solve it! Ask the experts for advice. . .
code show as below:
The public network address of the minimum server you bought cannot be used to directly access the node server. It is recommended that nginx be used as a proxy for localhost.
The official explanation given by Alibaba Cloud.
Or change the hostname to: 127.0.0.1 and then access the public network address.
Reference: http://www.jianshu.com/p/0c8c...
Hostname cannot specify the router IP. . . It can only be specified as the IP of the network card or: 0.0.0.0
Remove hostname, app.listen method.
Did you specify that you want to listen on this network card?
So, ifconfig determines whether this IP is the IP of a certain network card on this machine