How can I see what pages are being accessed at my website?

Got questions? Go ahead: Ask me anything!

Anonymous asks:

I'd like to watch my Apache logs as new visitors come. How can I see what pages are being accessed in real time?

I'm so happy you said Apache, because if you had said IIS, not only wouldn't I have had to do painful research to answer you, but I would have thought less of you for foolishly running your web server on that abysmal platform!

It's so easy on any Linux system. Assuming your logs are in Common Log Format, you can just go to a Bash prompt and do this:


$ sudo tail -f (wherever your logs are)logs/access.log | grep "html HTTP"
54.176.177.216 - - [29/Apr/2015:07:23:29 -0400] "GET /index.html HTTP/1.1" 200 4829 "-" "Mozilla/5.0 (compatible; oBot/2.3.1; http://filterdb.iss.net/crawler/) X-Middleton/1"
54.176.93.15 - - [29/Apr/2015:07:23:31 -0400] "GET /index.html HTTP/1.1" 200 4829 "-" "Mozilla/5.0 (compatible; oBot/2.3.1; http://filterdb.iss.net/crawler/) X-Middleton/1"
54.176.93.15 - - [29/Apr/2015:07:23:44 -0400] "GET /Tests/SCO/q0575.html HTTP/1.1" 200 1526 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp) X-Middleton/1"
54.176.93.15 - - [29/Apr/2015:07:24:09 -0400] "GET /Unixart/understanding_load.html HTTP/1.1" 200 7688 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html) X-Middleton/1"
54.193.221.77 - - [29/Apr/2015:07:24:41 -0400] "GET /wwwboard/messages/676.html HTTP/1.1" 301 566 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) X-Middleton/1"
54.193.221.77 - - [29/Apr/2015:07:24:41 -0400] "GET /Web/linode-web-hosting.html HTTP/1.1" 200 7857 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) X-Middleton/1"
54.176.93.15 - - [29/Apr/2015:07:24:42 -0400] "GET /Unixart/driverart.html HTTP/1.1" 200 7747 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) X-Middleton/1"
 

If your logs are NOT in that format, this might work anyway or I bet you can figure out what to change.

That works on Mac OS X too. Your own logs might be in /private/var/log/apache2. You can find the main logs in /var/log/apache2 also and can use Utilies-> Console to view them.

Apache logs on Apple Mac OS X

But of course you need "tail" and "grep". You don't have those on Windows unless you install Services For Unix or CygWin, but sometimes even that doesn't work well and you may not want to install all that stuff just for this. Maybe something here will help. That Baretail Pro looks like it would do the job.

My question for you is: How much time do you spend watching log files? Haven't you better things to do?

No, I'm kidding. I do this too, and I don't have to be all that bored - just curious as to what's going on NOW!



Got something to add? Send me email.





(OLDER) <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> How can I see what pages are being accessed at my website?




Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Anthony Lawrence



Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. (Donald Knuth)

When Life Gives You Questions, Google has Answers (AJ Carpio)







This post tagged: