I want to know which process to kill using port number 80

Asked 2 years ago, Updated 2 years ago, 118 views

I am currently studying Docker, and I am referring to My first Docker for Mac.

In conclusion, Which process ID should I kill?Also, please let me know why you kill the process ID out of several.

 docker run-d-p 80:80 -- name webserver nginx

When I ran , I received an error stating that 80 is already in use.
So I was going to kill 80 processes, but I don't know which one to kill because it looks like the following:

 sudo lsof-P-i:80

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd97root4u IPv60t0TCP*:80 (LISTEN)
httpd409_www4u IPv60t0 TCP*:80 (LISTEN)
httpd55456_www4u IPv60t0 TCP*:80 (LISTEN)
httpd55457_www4u IPv60t0 TCP*:80 (LISTEN)
httpd55458_www4u IPv60t0 TCP*:80 (LISTEN)

I don't know which one to kill because I don't know which one to kill, and I don't know if killing 80 ports doesn't cause any problems, or what the range of influence is, so I can't kill easily.

I looked it up online, but I couldn't get a definite answer, so I asked you a question.

Which process ID should I kill?Also, please let me know why you kill the process ID out of several.

linux macos docker bash

2022-09-30 21:46

1 Answers

The lsof command lists httpd, so the Apache process is probably already up and using the :80 port.

Try stopping Apache by executing the following command:

$sudo apachectl stop


2022-09-30 21:46

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.