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?

Some material is very old and may be incorrect today

© 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; http://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; http://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; http://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; +http://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; +http://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; +http://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; +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!

If you found something useful today, please consider a small donation.

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:

Take Control of the Mac Command Line with Terminal, Second Edition

iOS 10: A Take Control Crash Course

Take Control of Upgrading to El Capitan

Take Control of OS X Server

Take Control of iCloud

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

Getting information off the Internet is like taking a drink from a fire hydrant. (Mitchell Kapor)

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