February 04, 2012, 15:14:06 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Check your Page Rank, Backlinks, or Link Popularity in our tools section.
 
  Home   Forum   Help Search Directory Calendar Login Register    RSS 2.0 feedAtom feed


News
Check your Page Rank, Backlinks, or Link Popularity in our tools section.
Pages: [1]
  Print  
Author Topic:

Open port

 (Read 4782 times)
0 Members and 1 Guest are viewing this topic.
xulescu
Administrator
Sr. Member
*****

Points: 8
Offline Offline

Posts: 257


WWW
« on: July 17, 2006, 03:58:20 »

Hi,

 I don't know in what forum to put this question ... if is not ok please moveit.

 How can I see what program is listening on a specific port ? I get an error on  my mysqlserver and it tell me something about "The port 3306 is already used" ...

Logged



TheGodFather
Administrator
Hero Member
*****

Points: 202
Offline Offline

Posts: 2570



WWW
« Reply #1 on: July 17, 2006, 04:05:33 »

Hi,

 To see if the port is used (is listening) then :

Code:
#for tcp
netstat -tnl
#for udp
netstat -unl

To see what process (program) is using a specific port then:

Code:
fuser -n tcp 80

where 80 is the port. You will get minimum 1 pid or more if is a multithreaded server (apache for example). Ex:

Code:
80/tcp:               2193  2277  2278  2279  2295  2813  3982  3983  8733  8734  8739

Now if you see what process it is :

Code:
ps auxwww | grep 2193

and the answer will be
Code:
root      2193  0.0  6.0 30232 7628 ?        Ss   Jul16   0:00 /usr/sbin/apache2 -k start -DSSL

It's enough for you ?

Regards
Logged

xulescu
Administrator
Sr. Member
*****

Points: 8
Offline Offline

Posts: 257


WWW
« Reply #2 on: February 26, 2011, 01:30:45 »

The answer is:

fuser -n tcp 80

and you will get the pid as the result. after that just look after this pid and you will see the process.

ps auxwww | grep <pid>

Is everything explained in the second post.

Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
Valid XHTML 1.0! Valid CSS!