安装tomcat不成,发现端口占用问题,于是搜索了查看端口使用情况,并要找出是那个应用在使用端口。(我的tomcat端口被我修改为80)方法如下:
[color=green]C:\Documents and Settings\Administrator>netstat -an
Active Connections
Proto Local Address Foreign Address State
[b]TCP 0.0.0.0:80 0.0.0.0:0 LISTENING [/b]
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING
TCP 127.0.0.1:5152 0.0.0.0:0 LISTENING
TCP 192.168.1.102:139 0.0.0.0:0 LISTENING
TCP 192.168.1.102:2424 119.75.213.50:80 ESTABLISHED
TCP 192.168.1.102:2426 202.108.23.147:80 TIME_WAIT
TCP 192.168.1.102:2428 202.108.23.147:80 TIME_WAIT
TCP 192.168.1.102:2431 119.75.215.11:80 ESTABLISHED
TCP 192.168.1.102:2435 202.108.23.147:80 TIME_WAIT[/color]
可以看到端口(如80被占用),但无法查明是哪个程序在使用。于是添加-o参数,显示PID:
[color=green]C:\Documents and Settings\Administrator>netstat -ano
Active Connections
Proto Local Address Foreign Address State PID
[b]TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 3056[/b]
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 1084
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 1236
TCP 127.0.0.1:5152 0.0.0.0:0 LISTENING 460
TCP 192.168.1.102:139 0.0.0.0:0 LISTENING 4
TCP 192.168.1.102:2493 221.4.246.69:9877 CLOSE_WAIT 3952
TCP 192.168.1.102:2560 202.108.23.147:80 TIME_WAIT 0
TCP 192.168.1.102:2567 125.39.78.30:80 TIME_WAIT 0
TCP 192.168.1.102:2568 125.39.78.30:80 TIME_WAIT 0[/color]
然后,在任务管理器的“查看”中选中PID项,显示内容如下:
映像名称 PID 用户名 CPU 内存使用
[color=red]ThunderService 3056 eidolon 00 19,836K[/color]
可以看到是迅雷的服务占用了80端口,可以把迅雷关掉之后在启动tomcat服务器,就不会再报错了,自己的学习心得记下!
[color=green]C:\Documents and Settings\Administrator>netstat -an
Active Connections
Proto Local Address Foreign Address State
[b]TCP 0.0.0.0:80 0.0.0.0:0 LISTENING [/b]
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING
TCP 127.0.0.1:5152 0.0.0.0:0 LISTENING
TCP 192.168.1.102:139 0.0.0.0:0 LISTENING
TCP 192.168.1.102:2424 119.75.213.50:80 ESTABLISHED
TCP 192.168.1.102:2426 202.108.23.147:80 TIME_WAIT
TCP 192.168.1.102:2428 202.108.23.147:80 TIME_WAIT
TCP 192.168.1.102:2431 119.75.215.11:80 ESTABLISHED
TCP 192.168.1.102:2435 202.108.23.147:80 TIME_WAIT[/color]
可以看到端口(如80被占用),但无法查明是哪个程序在使用。于是添加-o参数,显示PID:
[color=green]C:\Documents and Settings\Administrator>netstat -ano
Active Connections
Proto Local Address Foreign Address State PID
[b]TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 3056[/b]
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 1084
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 1236
TCP 127.0.0.1:5152 0.0.0.0:0 LISTENING 460
TCP 192.168.1.102:139 0.0.0.0:0 LISTENING 4
TCP 192.168.1.102:2493 221.4.246.69:9877 CLOSE_WAIT 3952
TCP 192.168.1.102:2560 202.108.23.147:80 TIME_WAIT 0
TCP 192.168.1.102:2567 125.39.78.30:80 TIME_WAIT 0
TCP 192.168.1.102:2568 125.39.78.30:80 TIME_WAIT 0[/color]
然后,在任务管理器的“查看”中选中PID项,显示内容如下:
映像名称 PID 用户名 CPU 内存使用
[color=red]ThunderService 3056 eidolon 00 19,836K[/color]
可以看到是迅雷的服务占用了80端口,可以把迅雷关掉之后在启动tomcat服务器,就不会再报错了,自己的学习心得记下!