Ubuntu: Port seems to be open, but connection refused

preview_player
Показать описание
Ubuntu: Port seems to be open, but connection refused

Question: I am trying to open port 3000 on Ubuntu 12.04, cause I have a web server
listening there. I'm a bit out of my confort zone here, and spent many hours
trying to solve the problem without success.
Port seems to be open in the firewall :
$> sudo ufw status
Status: active

To Action From
-- ------ ----
...
3000/tcp ALLOW Anywhere
3000/tcp ALLOW Anywhere (v6)
The server is listening alright on that port :
$> netstat -an | grep "LISTEN "
...
tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN
...
And I can even wget alright the index page :
$> wget localhost:3000
Connecting to localhost (localhost)|127.0.0.1|:3000... connected.
HTTP request sent, awaiting response... 200 OK
And the received file contains what I expect ("hello world" :).
get "connection refused", and nmap tells me that the port is not open :
Host is up (0.00032s latency).
...
Not shown: 999 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 5.9p1 Debian 5ubuntu1 (protocol 2.0)
...
Service Info: OS: Linux
Any idea what I should try next ???
EDIT
Here's what traceroute gives :

Solutions Sample (Please watch the whole video to see all solutions, in order of how many people found them helpful):

== This solution helped 12 people ==
I had this problem recently with a nodejs HTTPS server, and the solution to it
was not to use "localhost", "127.0.0.1" or even the domain name. It was to use
"0.0.0.0"
I believe this acts as a wildcard, now allowing for public resolution via the
domain name and it also works with "localhost"
Edit: Here's a link to a serverfault page on the 0.0.0.0 topic: https://
0-and-127-0-0-1

Рекомендации по теме