NodeJS Pipe 443 already in use - node.js

I'm running an https server with pagekite and sometimes this error happens. Can someone explain to me what this is? I can't solve with lsof and kill

Use
netstat -an
in windows or
netstat -tulpn
in Linux to see if port 443 (https://) is taken by a process.

Related

Can't use port 8080

When I'm trying to run a service (RavenDB) on port 8080 it stops and the Windows Logs show the following error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: Failed to listen on prefix 'http://+:8080/' because it conflicts with an existing registration on the machine.
Acccording to IIS and netstat -an | find "8080" the port is currently not in use.
If I change the port to any other, the problem disappears.
Port 8080 may actually be in use. To replicate another answer
netstat -a only lists connected sockets and listening socket.
-a Displays all connections and listening ports. Neither
connect nor listen was called on your socket, so it falls outside the
purview of netstat -a.
However, since Windows 10, you can use netstat -q.
-q Displays all connections, listening ports, and bound
You could also try to view the port using tcpview from the SysInternals suite. Sort by port number. It will also tell you the process using the port, which you can then kill.

Disable Port blocking on linux

I have shut down iptables for my server, inspite of that when I check on http://www.yougetsignal.com/tools/open-ports/ it says my ports are not open.
Where do I have to specify to open ports. I am running a linux server
Is your server/PC behind a NAT router? If so, you may need to port forward the required ports to your server/PC. A helpful website for guides on how to do so (as it depends on your router model) is http://portforward.com/
If your server is not behind a NAT router or if you've verified you're port forwarding, is the application that's supposed to be listening on the specific port even running? Try this:
netstat -anp | grep <port number>
Netstat manual page: http://linux.die.net/man/8/netstat
If you can't find the port as listening on netstat, make sure that the application is running.
You need a server program (daemon) running on a machine listening on a port for that port to be open.
Setup the 'nmap' package on your server with 'yum install nmap -y' and check listening ports on your server:
nmap localhost
If you can see your port listening then you need to check your router for proper port forwarding, else you need to make sure that your application is working and listening for the port.
For the example, Apache2 will listen for port 80 by default.

Apache httpd:bind:Address already in use

When I cross compile appache into DM8168,It appears "httpd:bind:Address already in use".I changed the port 80 to any,such as 8080,90...It doesn't work either.Could anyone tell me why?Thanks for your help.
make sure port 80 is not used by any other service or application with netstat command:
netstat -tulpn| grep :80
If port 80 or other port which you assigned (8080,90)is bind to httpd, kill all process:
killall -9 httpd
Now start the httpd:
/etc/init.d/httpd start
Also make sure you are root while starting the httpd service.

Node Error: EADDRINUSE, how do I find out what process is locking this address?

I have a test app using express that crashes on server.listen(80): ERROR: listen EADDRINUSE. I tried to kill all node processes with killall -9 node but there were no processes. I also have apache running on the same server but I've got two IPs and I have configured apache to serve only one of them and yesterday everything worked fine. Some process is blocking port 80 on IP reserved for node and it's not node. What should I do?
UPDATE
That was my own lame mistake. I defined node_ip and node_port but accidently omitted node_ip in server.listen.
You could use
lsof -i :80
to see what process is running on that port.
if you want to see it first, you can use netstat, e.g.
netstat -tulpn | grep 80
You can use tcpkill ie.:
tcpkill -i eth0 port 80

netstat commands to run on unix server, what commands should I use for my use-case and why?

Sorry in advance for such a noob question, but I'm certainly a noob.
My question is what does it mean to LISTEN or ACCEPT on a port as it relates to my example?
EXAMPLE:
I have a tomcat server, and It will use port 8080. I want to make sure that port is available for me to use.
What commands should I perform on my unix server and why?
what information would a command like this give me: netstat -an | grep LISTEN
If a port shows up as LISTEN in netstat, it means the port is in use by a server process, so you can't use it. Here is an example:
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
which shows that port 631 is in use.
Ignore the UNIX type sockets at the end - they are irrelevant.
For checking port 8080 is in use or not, you can simply use the command netstat -an|grep 8080. If you get an output in below format, that means 8080 is already in use and you need to assign a new port for the tomcat.
# netstat -an
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN
Netstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc,
a option with netstat will give you both listening and non listening ports
n option when you don’t want the name of the host, port or user to be displayed, use netstat -n option. This will display in numbers, instead of resolving the host name, port name, user name. This also speeds up the output, as netstat is not performing any look-up.
For more understand the use of netstat command here are its options:
-a : All ports
-t : Ports TCP
-u : Ports UDP
-l : Listening ports
-n : IP address without domain name resolution
-p : Name of the program and it associated PID
So:
-To display all port (TCP & UDP), PId with the associated name of the program :
$ netstat -paunt
-To display all Listening ports (TCP), PId with the associated name of the program : (and we can also filter with the grep command)
$ sudo netstat -plnt | grep ':80'
I hope it will be helpful :)
You can also use telnet to check if the port is open and listening e.g,
Zeeshan$ telnet google.com 80
Trying 173.194.35.5...
Connected to google.com.
Escape character is '^]'.
I am telnetting google.com on port 80. If you see the third line in the output, you will notice it says it is connected with the Google's web server. The same way you have a JAVA application server called Tomcat and it is listening on port 8080. In fact it is asking clients to connect to it on port 8080 so it can give away the JAVA services to client. When I will use from a client side telnet localhost 8080 I will be connected the same way I have connected with Google's web server on port 80. Provided that Tomcat is running and listening on port 8080. If port 8080 is not free and occupied by some other application you can simply change the port 8080 to another free port. Telnet should give you the following status:
accepted (connected), refused, and timeout
connection refused - nothing is running on that port
accepted - some application is running on the port
timeout - a firewall is blocking access
So now there are two possible ways to check. From the same machine you are running Tomcat server:
telnet localhost 8080
Of if you want to check it from some other machine or outside of the network:
telnet 192.168.1.1 8080
I hope that helps.
use can also run the below command, it will list the Port and corresponding PID, if any process is using those ports
netstat -tulpn

Resources