Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out what is running on my port 80 on a Mac OSX

Tags:

http

docker

macos

I'm trying to start a hello-world container app that I just build using nodejs on my Mac OS X.

docker run -p 80:80 --name web -d node-hello

343503e8a29ac207c821caa7990373580dd6a1951e1e4936bbf9c71b0eff2213
docker: Error response from daemon: driver failed programming external connectivity on endpoint web (e6035cf3ae4df37f1a96a5a7ed321e6a0ae7ad484c05aae8d7b67f3d86fa3a76): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error (Failure EADDRINUSE). 

Debug Steps

I went to the address

enter image description here

I ran this

lsof -i ":80"

and got

COMMAND   PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Google    956 bheng  225u  IPv6 0x5bed1c283af57fa7      0t0  TCP [2607:f518:15e:9540:3105:c54f:bd3c:14ed]:63120->yul02s04-in-x10.1e100.net:http (ESTABLISHED)


(netstat -an | grep LISTEN | grep 80) 
tcp4       0      0  127.0.0.1.4380         *.*                    LISTEN                                                                
tcp46      0      0  *.80                   *.*                    LISTEN 

How do I find out what is exactly running on my port 80 right now ?

like image 823
code-8 Avatar asked Nov 16 '18 14:11

code-8


People also ask

What is listening on port 80 macOS?

This /usr/sbin/httpd is listening on port 80, should be Apache server.

How can I see what's running on port Mac?

You can find out what is running on a specific port by running the command lsof -i with the port number, :<PortNumber> .


1 Answers

Prefix lsof with sudo to see process ids that you don’t own.

sudo lsof -i:80
like image 161
bakhoang Avatar answered Nov 15 '22 06:11

bakhoang