How to find the process that is using the port 80 and apache server.


 
Thread Tools Search this Thread
Operating Systems Solaris How to find the process that is using the port 80 and apache server.
# 1  
Old 05-22-2008
How to find the process that is using the port 80 and apache server.

How to find the process that is using the port 80 and apache server.

When i used the command 'netstat -a|grep 80' it given that port 80 is in listening mode.

I had used the following command:
telnet localhost 80
GET /

I had got some HTML script.

But when I accessed the GUI ( url is http:// ip address of server/hawk.htm )which uses the script '/usr/local/apache/htdocs/hawk.htm' using apache server ( for which default server is 80 and document root is "/usr/local/apache/htdocs") it is different.

Why this is happening.

I am little confused here.
# 2  
Old 05-22-2008
friend there is no command that you can execute that will tell you which process id tied to port 80, stop creating threads everywhere.

To trace what is using a certain port

netstat -an | grep \\.80

will list out the IP address that is using port 80, then of course from there once you have the IP address you should know in your company/organisation which are the webservers that are using which IP address, this knowledge is domain you must know.

The purpose of using telnet localhost 80; GET /

is used for troubleshooting to isolate problems only. If client cannot access url but when determined that telnet GET / is able to return some ascii output means there's nothing wrong with webserver and isolate that it's probably a client connectivity issue.

Of course when you are troubleshooting you must also know what you are doing.
# 3  
Old 05-22-2008
Actually lsof can tell you which process is listening to a port.
# 4  
Old 05-22-2008
Quote:
Originally Posted by sparcguy
friend there is no command that you can execute that will tell you which process id tied to port 80, stop creating threads everywhere.

To trace what is using a certain port

netstat -an | grep \\.80

will list out the IP address that is using port 80, then of course from there once you have the IP address you should know in your company/organisation which are the webservers that are using which IP address, this knowledge is domain you must know.

The purpose of using telnet localhost 80; GET /

is used for troubleshooting to isolate problems only. If client cannot access url but when determined that telnet GET / is able to return some ascii output means there's nothing wrong with webserver and isolate that it's probably a client connectivity issue.

Of course when you are troubleshooting you must also know what you are doing.


When i given the command netstat it resulted as follows (not IP)

netstat -an | grep \\.80

*.80 *.* 0 0 49152 0 LISTEN
# 5  
Old 05-22-2008
Quote:
Originally Posted by era
Actually lsof can tell you which process is listening to a port.
when i given 'lsof' it resulted as:

lsof: Command not found
# 6  
Old 05-22-2008
Are you sure you have the correct document root ?
run
Code:
ps -ef | grep http

and make sure you are looking at the correct apache instance, there are 2 in Solaris, so it depends on which one you are running
Tornado
# 7  
Old 05-22-2008
Quote:
Originally Posted by vamshikrishnab
when i given 'lsof' it resulted as:

lsof: Command not found
lsof is not part of Solaris and doesn't support it properly anyway.

Use pfiles instead.

i.e.:
Code:
pfiles /proc/* > /tmp/pfiles.out

Then look for which process is using port 80 by searching "port: 80" in the pfiles.out file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

2. IP Networking

Tcp ip port open but no such process (merged: Release A Port)

i want to kill a tcp connection by killing its pid with netstat -an i got the tcp ip connection on port 5914 but when i type ps -a or ps-e there is not such process running on port 5914 is it possible that because i do not log on with proper user account i can not see that process running? (30 Replies)
Discussion started by: alinamadchian
30 Replies

3. UNIX for Dummies Questions & Answers

Server has more TIME_WAIT connections in Apache(port 80)

Server has more TIME_WAIT connections in Apache(port 80) Hi, My webserver has 16GB of RAM and CentOS 5.5, Apache 2.2.3, It's shared webserver used of for webhosting. I have optmized the server as : <IfModule prefork.c>... (4 Replies)
Discussion started by: chandranjoy
4 Replies

4. Web Development

How to find number of http connections active currently in apache web server

Hi I have a solaris 9 OS with apache web server running on top of it. i want to know how many http connections are active at any point in time. (In other words how many users are accessing my website it at any moment of time) How to get it..? hit counters are not required... ----------... (0 Replies)
Discussion started by: aemunathan
0 Replies

5. AIX

How to find what process is using a port in AIX 5L and above.

There have been a lot of threads about how to find processes that are using a specific port on an AIX server. After long hours of research and reading countless "you can't do that" responses, I finally found the answer. YES IT CAN BE DONE! YES ITS EASY. NO, I DON'T KNOW WHY NO ONE GETS THIS... (2 Replies)
Discussion started by: troym72
2 Replies

6. Shell Programming and Scripting

Find the process in different server

suppose there are in 10 different server how can i know in which server a process (ex:oracle )is running (6 Replies)
Discussion started by: alokjyotibal
6 Replies

7. Shell Programming and Scripting

Find port number being used by a given process id

Unix gurus, I have a requirement wherein I want to find the port number for a given process id. Is it possible? If so how? TIA, Regards, Praveen (3 Replies)
Discussion started by: sunpraveen
3 Replies

8. UNIX for Dummies Questions & Answers

Find what process on port number

Hi, I am on a Sun Solaris and I want to find out which process is allocated on a certain port. How can I do that? BR Andreas (4 Replies)
Discussion started by: mr_andrew
4 Replies

9. UNIX for Dummies Questions & Answers

How to find the port number of the oracle process

Hi Unix Gurus, Can we find out the port number used by the oracle process is running.I tried to search the forum but coudnt find. Can anyone help me out with the command (2 Replies)
Discussion started by: thana
2 Replies

10. IP Networking

how to find port numbers a web server is listening to

I want to write a program to list all port numbers a process like web server is listening to.Is there a any unix command to find the port numbers and the processes(pid) connected to that port. (6 Replies)
Discussion started by: laddu
6 Replies
Login or Register to Ask a Question