Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need a command or something to see live web viewer in Apache2 web server, in other word i want see the ip address of active connection and i found some commands like :

netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1

netstat -plan|grep :80 | wc -l

netstat -an | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | awk '{ printf("%s\t%s\t",$2,$1) ; for (i = 0; i < $1; i++) {printf("*")}; print "" }'

But i can't understand it completely . My questions are :

1 - Is there any other command to server this purpose ?

2 - What is the the state of live visitors in netstat (Establish or Connected) ?

share|improve this question
add comment

3 Answers

  1. I think for seeing current ip connectivity only this is the command there . You can refer this for advacned usage http://www.thegeekstuff.com/2010/03/netstat-command-examples/

  2. It shows all type of connections time_out , Time_wait , and connected and established in state .

For the above commands, you can do google

share|improve this answer
    
Thanks for your answer , but i want to know when a visitor , viewing the page , what is the state of his/her connection ? –  user180445 Mar 20 '13 at 8:17
    
Well all you have to do is lookup tools to get the ip address and then the netstat to view their connection activity which is shown in status.There are many lookup tools available to work with cpanel the linux variant , sometimes your web hoster will give you the tool himself. –  adithya Mar 20 '13 at 9:12
    
If it has helped you please tick green TICK MARK . It will help the future users . –  adithya Mar 24 '13 at 18:16
    
I am looking for precise answer , i don't leave it be.as soon as i get it i put the answer here for other user, thanks. –  user180445 Mar 24 '13 at 18:43
add comment

Check out Apache mod_status, this gives an overview of activity at the HTTP level and might be what you're looking for.

Sample output of mod_status

share|improve this answer
    
Note that to avoid using a web browser, you can run apachectl fullstatus. (This still uses an HTTP connection, however, so you still need to fully configure mod_status before using it). –  pistache Mar 20 '13 at 9:04
    
@pistache it doesn't need a GUI web browser, but it does need a text mode browser –  Rich Homolka Apr 12 '13 at 2:49
add comment

TCP sessions with respect to HTTP are very short lived. Unless I'm viewing a large file, the TCP sessions change to FIN_WAIT_2 and TIME_WAIT within 5 or 10 seconds, so for stateful HTTP connections, web server utilities such as mod_status and apachectl will need to be used. In other words, there isn't a relationship between TCP session state, and an HTTP session state.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.