Linux –ポート8080を使用しているアプリケーション
常に、Java開発者は、どのアプリケーションが高需要の8080ポートを使用しているかを知る必要があります。 このチュートリアルでは、Linuxでポート8080を使用しているアプリケーションを見つける2つの方法を示します。
1. lsof + psコマンド
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
複数の結果がある場合は、lsof -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 + Tomcat8はポート8080を使用しています。
2. netstat + psコマンド
同じことを行うためのコマンドが異なります。netstat -nlp | grep 8080
と入力してPIDを取得し、ps
と入力します。
$ 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 //...