[advanced search]
20 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Webmaster Tutorials
User Name
Password

Old 05-16-2008, 09:23 PM   · #1
mike123106
NamePros Regular
 
mike123106's Avatar
 


Name: MJ
Location: Tucson AZ
Trader Rating: (50)
Join Date: Jul 2007
Posts: 568
NP$: 1345.17 (Donate)
mike123106 is a splendid one to beholdmike123106 is a splendid one to beholdmike123106 is a splendid one to beholdmike123106 is a splendid one to beholdmike123106 is a splendid one to beholdmike123106 is a splendid one to beholdmike123106 is a splendid one to beholdmike123106 is a splendid one to behold
Autism Special Olympics
Lightbulb Real Time Visitor Stats!

Hey guys. Y'all ever think "man I wish I had real time stats to know when someone is on my site, where they are clicking, what site reffered them". Guess what, you CAN! Woohoo! Apache, the most comon webserver keeps logs of such actions. Logging into your box via the shell, we can see these live stats. Ready? Lets go!

Step 1: Ok, first log into your shell. (SSH always - telnet is not secure at all) Putty is a free SSH client if anyone needs, just type in your domain and boom.


Now we are inside the linux box. Its as if we are sitting right there and we can control it remotely.

Step 2: Lets go to the directory with all our logs in it for all domains hosted on the box. All domains hosted on the box should have a log here. Different servers and configurations might be slightly different but most if not all are located here. Also, if you are not root user its ok. You may only be able to see YOUR domain stats though. Example, if I am bob.com I might not be able to see Mike.com unless super user.




Step 3: Alright. Now we can use any linux command to view these logs. In this example, we want to be constantly looking at the very last part of the log file, to get real time stats, so we will type tail -f domain.com In this case we want the logs for OurVote.us so we type [b]tail -f ourvote.us[b]


Ready for our results???



Amazing! You can see what IP your current visitor is from, what browser he is using, what OS he has, what refferal URL he came from, what current URL he is on now, etc! This screen will update real time. So if you have a high traffic site, watch our your screen might get flooded.

But yep.. This is how lots of site trackers work too. Your webbrowser and webserver interact nicely with each other and give you this data.

Hope yall found this usefull.. This was my first turorial - Made it originally for Invest1010 but thought the world should be more aware of this techniqe. Take care guys!


Please register or log-in into NamePros to hide ads
mike123106 is online now   Reply With Quote
Old 05-16-2008, 09:34 PM   · #2
-PS-
NamePros Regular
 
-PS-'s Avatar
 
Name: Justin
Location: Sydney
Trader Rating: (16)
Join Date: Jun 2006
Posts: 249
NP$: 205.95 (Donate)
-PS- will become famous soon enough-PS- will become famous soon enough
Just to add in a few other commands that will help a little more

tail -f <logfile> &

This will allow you to still use the console (ie do other stuff) and the log tailing will still work

also another good one which will get rid of alot of the noise in the log file (like images etc) is

tail -f <log file> | egrep -v "jpg|png|ico|css|gif|js|feed|rss|Slurp|GoogleBot|ms nbot"

This will also not sure bots indexing your site, they usally hit in batches, and might load upto 100 pages in a few minutes, so it's a good idea to filter them out as well.
-PS- is offline   Reply With Quote
Old 05-16-2008, 09:52 PM   · #3
Hostnetric
NamePros Regular
 
Name: Kevin
Location: Lima, Ohio
Trader Rating: (13)
Join Date: Jul 2005
Posts: 371
NP$: 28.00 (Donate)
Hostnetric has a spectacular aura aboutHostnetric has a spectacular aura about
Thanks for sharing Mike I didn't know about this and am glad to know myself. I am going to try it on my sites now as well to see how it works out for me.

Thanks,

Kevin
__________________
Hostnetric Web Hosting
WoWBasic World of Warcraft Blog
The Penny Ads Free Classified Ads
Hostnetric is offline   Reply With Quote
Old 06-11-2008, 07:45 PM   · #4
mholt
DNOA Member
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,850
NP$: 17.21 (Donate)
mholt has much to be proud ofmholt has much to be proud ofmholt has much to be proud ofmholt has much to be proud ofmholt has much to be proud ofmholt has much to be proud ofmholt has much to be proud ofmholt has much to be proud ofmholt has much to be proud ofmholt has much to be proud ofmholt has much to be proud of
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Hey, this is most helpful. Rep ++ for both Mike and Justin. I did not know this little trick.
__________________
FREE: Help With Code

Includes other technical topics:
programming, development, Windows, domain names, and Internet
mholt is offline   Reply With Quote
Old 06-12-2008, 06:58 AM   · #5
purustotle
NamePros Member
 
Location: Finland
Trader Rating: (0)
Join Date: Dec 2005
Posts: 53
NP$: 10.00 (Donate)
purustotle is an unknown quantity at this point
Thanks for the helpful tips! Too bad I don't run any servers myself
purustotle is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Build your NameBrand Build your NameBrand
Advertise your business at NamePros
All times are GMT -7. The time now is 04:32 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0