在启动Apache的时候遇到占用80端口,导致服务不能启动,于是CMD查占用80端口的进程..
直接命令杀死进程:
?
1.查进程:
netstat -b -n –a
-b 为列出进程,必须-b在前,不能是-a在前不然报错.
-n为端口号
?
查到是peer.exe 进程PID 632
2.杀占用80的进程
CMD下杀进程的命令ntsd.
ntsd –c q –p 632
632为我查到的进程 peer.exe(fs2you网络硬盘的程序)的id
截图:
CMD输出:
C:\Documents and Settings\Administrator>netstat -n -b -a
Active Connections
? Proto? Local Address????????? Foreign Address??????? State?????????? PID
? TCP??? 0.0.0.0:80???????????? 0.0.0.0:0????????????? LISTENING?????? 632
? [peer.exe]
? TCP??? 0.0.0.0:135??????????? 0.0.0.0:0????????????? LISTENING?????? 1236
^C
C:\Documents and Settings\Administrator>ntsd -c q -p 632
C:\Documents and Settings\Administrator>
?
杀完之后apache启动正常...
?
附录:
xp下还有两个好东东tasklist和 tskill。tasklist能列出所有的进程,和相应的信息。tskill能查杀进程,语法很简单:tskill 程序名!!
?
NETSTAT [-a] [-b] [-e] [-n] [-o] [-p proto] [-r] [-s] [-v] [interval]