Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out which process is using localhost:80? [closed]

Tags:

linux

port

lsof

I'm using linux mint xfce edition, my localhost:80 was used by some program but I don't which one, when I open firefox and visit localhost:80, it says

It works! This is the default web page for this server. The web server software is running but no content has been added, yet.

I've tried to use lsof -i @localhost:80, but it returns nothing.

like image 201
flyingfoxlee Avatar asked Jun 08 '13 02:06

flyingfoxlee


2 Answers

netstat -anpt | grep :80 as root user should list process using port 80. With your web browser closed it can help you identify the process.

like image 59
zeropol Avatar answered Sep 20 '22 01:09

zeropol


Try this:

# fuser -n tcp 80      

From the manpage:

-n SPACE, --namespace SPACE
      Select  a  different  name space.  The name spaces file (file names, 
      the default), udp (local UDP ports), and tcp (local TCP ports)
      are supported.  For ports, either the port number or the symbolic name can 
      be specified.  If there is no  ambiguity,  the  shortcut
      notation name/space (e.g. 80/tcp) can be used.
like image 29
guido Avatar answered Sep 19 '22 01:09

guido