日期:2014-05-16  浏览次数:20754 次

windows2003如何查端口占用
windows2003如何查端口占用

?

来自网络

?

启动应用的时候发现系统需要的端口被别的程序占用,如何知道谁占有了需要的端口

?

1、Windows平台
在windows命令行窗口下执行:
C:\>netstat -aon|findstr "80"
TCP 127.0.0.1:80 0.0.0.0:0 LISTENING 2448
看到了吗,端口被进程号为2448的进程占用,继续执行下面命令:
C:\>tasklist|findstr "2448"
thread.exe 2016 Console 0 16,064 K
很清楚吧,thread占用了你的端口,Kill it
如果第二步查不到,那就开任务管理器,看哪个进程是2448,然后杀之即可。

?taskkill?/F?/IM?nginx.exe

如果需要查看其他端口。把 80 改掉即可

补充:原来出现这个错误原因(httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.xx for ServerName)是因为DNS没配置好. 如果不想配置DNS, 就在httpd.conf , 在最前加入 ServerName localhost:80 即可


解决的方法就是补充中的一句话,修改httpd.conf中的ServerName IP:port与Listen IP:端口一致就OK了