728x90
[출처] http://java-monitor.com/forum/showthread.php?t=22
On FreeBSD:
Code:
% sockstat -4 -p 8080 USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS kjkoster java 80929 31 tcp4 *:8080 *:*
Code:
% lsof -i TCP:8080 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 37801 kjkoster 11u IPv6 0xa8c44bc 0t0 TCP *:http-alt (LISTEN)
Code:
% netstat -anp | grep 8080 Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name tcp        0      0 127.0.0.1:8080        0.0.0.0:*              LISTEN      1501/jsvc.exec
This gives us the process ID of the process that is bound to port 8080. They are shown in bold in the above examples.
Given this process ID we can examine the process in more detail using the command ps. Again, the precise syntax is OS-dependent.
On FreeBSD:
Code:
% ps -wwp 80929 PID TT STAT TIME COMMAND 80929 p1 I+ 0:04.61 /usr/local/jdk1.6.0/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/usr/home/kjkoster/apache-tomcat-6.0.16/conf/logging.properties -Djava.endorsed.dirs=/usr/home/kjkoster/apache-tomcat-6.0.16/endorsed -classpath :/usr/home/kjkoster/apache-tomcat-6.0.16/bin/bootstrap.jar -Dcatalina.base=/usr/home/kjkoster/apache-tomcat-6.0.16 -Dcatalina.home=/usr/home/kjkoster/apache-tomcat-6.0.16 -Djava.io.tmpdir=/usr/home/kjkoster/apache-tomcat-6.0.16/temp org.apache.catalina.startup.Bootstrap start
Code:
% ps -wwp 37801 PID TTY TIME CMD 37801 ttys000 0:04.33 /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/Users/kjkoster/Downloads/apache-tomcat-6.0.16/conf/logging.properties -Djava.endorsed.dirs=/Users/kjkoster/Downloads/apache-tomcat-6.0.16/endorsed -classpath :/Users/kjkoster/Downloads/apache-tomcat-6.0.16/bin/bootstrap.jar -Dcatalina.base=/Users/kjkoster/Downloads/apache-tomcat-6.0.16 -Dcatalina.home=/Users/kjkoster/Downloads/apache-tomcat-6.0.16 -Djava.io.tmpdir=/Users/kjkoster/Downloads/apache-tomcat-6.0.16/temp org.apache.catalina.startup.Bootstrap start
Code:
% ps -fp PID UID        PID  PPID  C STIME TTY          TIME CMD tomcat  1501 1500  1 Jul16 ?        03:29:42 jsvc.exec -home /usr/local/java -jvm server -user tomcat -Djava.endorsed.dirs=/usr/local/apache-tomcat-6/comm
This should help you clear out excess application servers and free up port 8080 to run your own application server on. Don't be afraid to experiment. UNIX protects the processes of other user's on your machine. So if you accidently try to kill a Tomcat from one of your co-workers, you will not do any damage to it. The kill command issues an error message and exits safely.
Earlier I said that process assasination would be faster than rebooting, but up until now you'f probably spend a couple of minutes trying out the commands. Rebooting would have been a lot faster, I'm sure. Let's tie the commands together to form a single command line that can be cut'n-pasted into a terminal.
On FreeBSD the commands tie together as shown below:
On Max OS X, it looks like this.
Code:
kill `lsof -i TCP:8080 | awk '/LISTEN/{print $2}'`
728x90
'tip' 카테고리의 다른 글
리눅스 관리 기법 (0) | 2013.09.30 |
---|---|
Microsoft Dynamics CRM을 통한 효과적인 영업기회 및 고객관리 방안 (0) | 2013.09.30 |
객체지향생활체조 (0) | 2013.07.26 |
scplugin server certificate verification failed (0) | 2013.07.11 |
System.Web.AspNetHostingPermission SecurityException when trying to use ManagedFusion Rewriter on Goddaddy (0) | 2013.06.20 |
댓글