Solution to the occupation of port Tomcat80 in Linux

Source: Internet
Author: User
Article title: Solution to the occupation of Tomcat port 80 in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Analysis: netstat-an shows that a large number of port 80 processes are dead, restart tomcat. tomcat fails to start, and the webpage still cannot be opened.

Stop the tomcat process shutdown. sh, stop tomcat, telnet 127.0.0.1 80, and find port 80 is still available. Netstat-an | grep 80 check shows that many port 80 processes are in it and kill the pid command to terminate the process. it is useless. Use the lsof-I: 80 | grep-v "PID" | awk '{print "kill-9", $2}' command to delete all port 80 processes. Restart tomcat and the system runs normally. However, the reason why tomcat cannot shut down the port 80 process at the same time needs to be analyzed.

[root@gzcourt bin]# netstat -an |grep 80

tcp 0 0 ::ffff:127.0.0.1:8005 :::* LIST

EN

tcp 0 0 :::8009 :::* LIST

EN

tcp 0 0 :::80 :::* LIST

EN

tcp 0 0 :::8080 :::* LIST

EN

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:202.160.179.12:36057 TIME

_WAIT

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:202.160.178.15:39176 TIME

_WAIT

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:218.20.57.173:55001 ESTA

BLISHED

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:218.20.57.173:3516 ESTA

BLISHED

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:218.20.57.173:55037 ESTA

BLISHED

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:218.20.57.173:3518 ESTA

BLISHED

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:61.135.162.208:57893 TIME

_WAIT

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:210.72.4.122:39196 ESTA

BLISHED

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:59.32.124.136:22529 ESTA

BLISHED

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:218.20.57.173:55222 ESTA

BLISHED

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:218.20.57.173:3510 ESTA

BLISHED

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:59.32.124.136:22530 ESTA

BLISHED

tcp 0 0 ::ffff:172.16.1.153:80 ::ffff:210.72.4.122:39198 ESTA

BLISHED

unix 3 [ ] STREAM CONNECTED 6880 /tmp/.X11-unix/X0

# lsof -i :80|grep -v "PID"|awk '{print "kill -9",$2}'|sh

The above script can clear the process of port 80

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.