Linux - Welche Anwendung verwendet Port 8080
Java-Entwickler müssen immer wissen, welche Anwendung den 8080-Port mit hohem Bedarf verwendet. In diesem Tutorial zeigen wir Ihnen zwei Möglichkeiten, um herauszufinden, welche Anwendung unter Linux Port 8080 verwendet.
1. lsof + ps Befehl
1.1 Bring up the terminal, type lsof -i :8080
$ lsof -i :8080 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 10165 example 52u IPv6 191544 0t0 TCP *:http-alt (LISTEN)
Note
Wenn mehrere Ergebnisse vorliegen, versuchen Sie es mitlsof -i :8080 | grep LISTEN
1.2 PID 10165
is using port 8080, type ps -ef | grep 10165
to find out the application details.
$ ps -ef | grep 10165 example 10165 4364 1 11:58 ? 00:00:20 /opt/jdk/jdk1.8.0_66/jre/bin/java //... -Djava.endorsed.dirs=/home/example/software/apache-tomcat-8.0.30/endorsed -classpath /home/example/software/apache-tomcat-8.0.30/bin/bootstrap.jar: /home/example/software/apache-tomcat-8.0.30/bin/tomcat-juli.jar -Dcatalina.base=/home/example/.IntelliJIdea15/system/tomcat/Unnamed_hc_2 -Dcatalina.home=/home/example/software/apache-tomcat-8.0.30 -Djava.io.tmpdir=/home/example/software/apache-tomcat-8.0.30 /temp org.apache.catalina.startup.Bootstrap start
Answer: IntelliJ IDEA + Tomcat 8 verwendet den Port 8080.
2. Befehl netstat + ps
Nur ein anderer Befehl, um dasselbe zu tun. Geben Sienetstat -nlp | grep 8080
ein, um die PID undps
zu erhalten.
$ netstat -nlp | grep 8080 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp6 0 0 :::8080 :::* LISTEN 10165/java $ ps -ef | grep 10165 example 10165 4364 1 11:58 ? 00:00:20 /opt/jdk/jdk1.8.0_66/jre/bin/java //...