Sometimes, when the software is disabled, the background process will die, causing the port to be occupied. The following describes how to solve the problem by taking TOMCAT Port 8060 as an example. Solution: 1. search for the occupied Port netstat-tlnnetstat-tln | grep & nbs
Sometimes, when the software is disabled, the background process will die, causing the port to be occupied. The following describes how to solve the problem by taking TOMCAT Port 8060 as an example.
Solution:
1. find the occupied Port
- Netstat-tln
- Netstat-tln | grep 8060
Netstat-tln is used to view port usage, while netstat-tln | grep 8060 is used to view port 8060 only.
2. check which program the port belongs? Which process occupies the port?
Lsof-I: 8060
Command pid user fd type device size/OFF NODE NAME
Java 20804 root 36u IPv6 35452317 0t0 TCP *: pcsync-https (LISTEN)
3. kill the process that occupies the port and kill it based on the pid.
Kill-9 process id
Kill-9 20804