APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

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

© April 2015 Anthony Lawrence

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" - - [29/Apr/2015:07:23:29 -0400] "GET /index.html HTTP/1.1" 200 4829 "-" "Mozilla/5.0 (compatible; oBot/2.3.1; https://filterdb.iss.net/crawler/) X-Middleton/1" - - [29/Apr/2015:07:23:31 -0400] "GET /index.html HTTP/1.1" 200 4829 "-" "Mozilla/5.0 (compatible; oBot/2.3.1; https://filterdb.iss.net/crawler/) X-Middleton/1" - - [29/Apr/2015:07:23:44 -0400] "GET /Tests/SCO/q0575.html HTTP/1.1" 200 1526 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; https://help.yahoo.com/help/us/ysearch/slurp) X-Middleton/1" - - [29/Apr/2015:07:24:09 -0400] "GET /Unixart/understanding_load.html HTTP/1.1" 200 7688 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +https://www.baidu.com/search/spider.html) X-Middleton/1" - - [29/Apr/2015:07:24:41 -0400] "GET /wwwboard/messages/676.html HTTP/1.1" 301 566 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +https://www.bing.com/bingbot.htm) X-Middleton/1" - - [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; +https://www.bing.com/bingbot.htm) X-Middleton/1" - - [29/Apr/2015:07:24:42 -0400] "GET /Unixart/driverart.html HTTP/1.1" 200 7747 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +https://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?

Inexpensive and informative Apple related e-books:

Photos: A Take Control Crash Course

Take control of Apple TV, Second Edition

El Capitan: A Take Control Crash Course

Take Control of High Sierra

Take Control of Upgrading to El Capitan

More Articles by © Anthony Lawrence

Printer Friendly Version

Have you tried Searching this site?

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

Printer Friendly Version

A learning experience is one of those things that say, "You know that thing you just did? Don't do that." (Douglas Adams)

Linux posts

Troubleshooting posts

This post tagged:






Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode

SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)