1834156 Members
2806 Online
110064 Solutions
New Discussion

Re: about network port

 
王曦_1
Occasional Advisor

about network port

hi expert,
i have a service must use the port 80, but when i start the service , it reply the port 80 was occupied by another process, how can i use command to find out this process which occupy the port,
thanks a lot
7 REPLIES 7
Michael Tully
Honored Contributor

Re: about network port

You will find that you most likely have an apache web server running on your server. It is uses port 80.
If your not using apache then you can disable it. IF you don't have it, you can use 'lsof' to find what is using it. You can get lsof from here:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.64/
Anyone for a Mutiny ?
Robert-Jan Goossens
Honored Contributor

Re: about network port

Hi ??

cat /etc/services | grep 80
http 80/tcp www # World Wide Web HTTP
http 80/udp www # World Wide Web HTTP

Hope it helps,

Robert-Jan.
Balaji N
Honored Contributor

Re: about network port

hi,

see if ps -ef | grep apache or httpd helps.

if not download lsof as pointed already.


another option is netstat.

netstat -ap.

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
W.C. Epperson
Trusted Contributor

Re: about network port

A specific way to use lsof to find this out:
lsof -n|grep TCP|grep ":80 "
"I have great faith in fools; self-confidence, my friends call it." --Poe
Ron Cornwell
Trusted Contributor

Re: about network port

netstat -a | grep 80 | grep LISTEN . It is probably a web server that is using the port.
Ron Cornwell
Trusted Contributor

Re: about network port

netstat -an | grep 80 | grep LISTEN . It is probably a web server that is using the port.
王曦_1
Occasional Advisor

Re: about network port

thanks