Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Who is attached to my server?

Status
Not open for further replies.

progolf069

Programmer
Jun 13, 2001
37
0
0
US
Does Apache have any type of commands or scripts that I can execute, so that I can see a count or list of people that are viewing my website - on any page (just on the server anywhere).

I am running a Apache WebServer on a RedHat Linux 7.2.

If you need any further discussion about my question (more detail, etc.) let me know.

Thanks for your assistance,
Ian
 
clarification..... I am looking to see CURRENT visitors -- at the moment I execute the script.

I already have history files being created based on information that I want to request.

Thanks again,
Ian
 
Since HTTP is a stateless protocol, and a connection is usually closed right away, there really isn't a way to accomplish what you want. //Daniel
 
If you use mod_status, you can look at snapshots of activity, including what's being viewed.

Beyond that, danielhozac is right. Considering that your users are only "logged in" for the duration of the time it takes to download a web page, and that browsers will pull up your content from cache whenever possible, concurrent HTTP user data is meaningless.

The best you can hope for is to know which users accessed the site during some (fairly large) window of time. You'll have to write that software to integrate with your user authentication mechanism. ______________________________________________________________________
TANSTAAFL!
 
Could put together a script to do netstat -a and graft off the list of unique connections to http:80, wow! now that would be a hammer to crack a nut!

why not tail -f /var/log/httpd/access.log | grep "name-of-your-script" |sed '{print $1, $6}' >> just_what_your_looking_for.log ?

Ok $1 should be IP Address and $6 (may or maynot B) the script name, you will need to play with it a bit.

Whatch out as the log file may fill your partition, worth adding another script to switch (cycle) the logfile now and then)?

Just some ideas.

Good luck.
 
Dude,

Just use netstat.
shnypr-small.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top