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:
曾经蜡笔没有小新2017-06-05 11:14:31
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...
过去多啦不再A梦2017-06-05 11:14:31
Hostname cannot specify the router IP. . . It can only be specified as the IP of the network card or: 0.0.0.0
黄舟2017-06-05 11:14:31
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