mardi 25 juin 2013

Freeing up a TCP/IP port



Usually when using tomcat server the following exception will be handled :

Several ports (8005, 8080, 8009, 8443) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).



To resolve this exception you need to free the TCP/IP ports that are already on 'LISTEN' state.
you'll have to kill all processes that are listening on that port. The easiest way to do that would be to use the fuser(1) command. For example, to see all of the processes listening for http requests on port 8080 (run as root or use sudo):


netstat -ln | grep ':8080 ' | grep 'LISTEN'



If you want to kill them, then just add the -k option.


fuser -k 8080/tcp
fuser -k 8443/tcp
fuser -k 8005/tcp
fuser -k 8009/tcp

Aucun commentaire:

Enregistrer un commentaire