3

Application work fine on localhost .but when its connect to server it getting error. I connect server through port 22

But my app connecting server port 80.

This is the error

 Error: listen EADDRNOTAVAIL Error: listen EADDRNOTAVAIL
 at errnoException (net.js:904:11)
 at Server._listen2 (net.js:1023:19)
 at listen (net.js:1064:10)
 at net.js:1146:9
 at dns.js:72:18
 at process._tickCallback (node.js:419:13)
 at Function.Module.runMain (module.js:499:11)
 at startup (node.js:119:16)
 at node.js:906:3

i run netstat -tulpn | grep 22

Result:

 tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      683/sshd
 tcp6       0      0 :::22                   :::*                    LISTEN      683/sshd

but i run netstat -tulpn | grep 80

Nothing Display.

Any Help.is this server fault?

running netstat -nlt

     Active Internet connections (only servers)
     Proto Recv-Q Send-Q Local Address           Foreign Address         State
     tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN
     tcp        0      0 127.0.0.1:5901          0.0.0.0:*               LISTEN
     tcp        0      0 127.0.0.1:5902          0.0.0.0:*               LISTEN
     tcp        0      0 0.0.0.0:6001            0.0.0.0:*               LISTEN
     tcp        0      0 0.0.0.0:6002            0.0.0.0:*               LISTEN
     tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
     tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN
     tcp6       0      0 :::22                   :::*                    LISTEN
     tcp6       0      0 ::1:631                 :::*                    LISTEN

Running netstat -anp | grep :80

     tcp        1      0 162.243.145.226:60728   91.189.94.25:80         CLOSE_WAIT  1726/ubuntu-geoip-p
     tcp        1      0 162.243.145.226:47842   74.125.239.148:80       CLOSE_WAIT  8104/epiphany-brows
     tcp        1      0 162.243.145.226:60727   91.189.94.25:80         CLOSE_WAIT  1417/ubuntu-geoip-p
     tcp        1      0 162.243.145.226:58818   198.41.30.199:80        CLOSE_WAIT  8104/epiphany-brows

This is source

source-link

2 Answers 2

0

Are you running the program as root?

If you are not running as root, you cannot bind any program to ports bellow 1024. They are considered privileged ports, and only root can use them.

If you want to run as root, don't. Running as root can create problems if someone exploits your program and gets a shell, and discovers it's a root shell.

Run as an unprivileged user, and change the port from 80 to something above 1024.

5
  • ok.then i use port as 3000.But still getting error.only want i change port in a App?
    – hash
    Oct 9, 2014 at 18:48
  • I don't know your application, so you will have to discover on the configuration options or files where to change the port.
    – ThoriumBR
    Oct 9, 2014 at 18:50
  • yes.in App i change the port. still getting this error.in server want i do any configuration for port 3000?
    – hash
    Oct 9, 2014 at 18:52
  • Any help please !!!
    – hash
    Oct 9, 2014 at 18:55
  • If you can run the application with a debug log setting, you can pinpoint exactly where is the problem. Otherwise nobody can really help you.
    – ThoriumBR
    Oct 9, 2014 at 18:58
0

From man 7 ip

ERRORS
       ...

       EADDRNOTAVAIL
              A  nonexistent  interface  was  requested  or  the  requested source
              address was not local.

You've probably mistyped the listen IP address to bind to in the config.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .