microapache.png (24029 bytes)

 

Home Page
MicroApache Guestbook
Tips and Tricks Page

    

This project is shared with the community at in good faith and at no cost and using whatever free time I have available. Sorry but I do not have time to give one-to-one support for Apache Webserver. If you use MicroApache then please link to this page or mention MicroApache! Please see the licensing conditions for each component

 

 

Apache Log-Monitoring MicroApache with Tail

Server logs and keeping your eye on them are the most important aspect of good webserver management. They can help you to shape the server configuration, develop new filters and rules and to focus on which content is popular and which isn't. Not to mention keeping your eye on miscreants and finding out where all of your bandwidth is going.

For general managerial use a good log analyser such as The Webalyzer is great to have run automatically on a regular schedule. Say daily on a busy server or maybe once a week on a less-busy one. But for day to day monitoring and diagnosis you really need to be able to watch the server logs in "real time"

This is where tail comes in. Tail allows you to monitor logs in real time. Updates to the file are displayed dynamically as they're added to the log file, line-by-line.

This site offers three versions of tail which are suitable for use with either MicroApache, standard Apache or any other compatible Win32 webserver. Each of them offers different advantages and disadvantages. All versions of tail have the advantage that they can efficiently view the "tail" end of the file no matter how large it is. The entire file is never read, just the last few bytes are they're added.

First of all, there's a plain command-line version which you can get here in the form of TailCMD.. This has basic filtering and highlighting of key words. It's an equivalent to the popular *nix command. This requires direct access to the server's log files.

Secondly there's a Windows GUI version - "Tail for Windows", which allows you to have numerous windows open to watch your server logs change in real-time. The advantage of this is that it's generally more flexible and easy to use with standard menus, buttons and dialogues. The disadvantage of TFW is that you need to be able to access the server's \LOGS\ folder either directly or via a local LAN connection which may not be possible if you're monitoring from a remote location. Tail for Windows also offers audible alerts each time the log file receives an update.

Lastly there's a compact Win32 CGI version called TailCGI which you can run from the server itself and view the logs within your favourite browser. The advantage of this is that, once installed on the server you need no software locally and, subject to access configuration you can monitor your logs from anywhere in the world.

All three versions are available from here as freeware for personal use.

tfw.jpg (31111 bytes)

There's no reason why you can't combine all 3 forms of log-monitoring at different times. I tend to use TailCGI most-often because it's quick to use, lightweight and it's convenient to bookmark particular log files once you've opened them. I use Tail for Windows on the server itself continuously for keeping an eye on the local DNS server or intrusion-logs as this makes it easy to see if my own DNS is having problems or my preferred external DNS service, OpenDNS is either blocked or down.

If you have a particularly busy server it is also vitally-important that you keep your log files small and filter only useful information from each page load. If you monitor every single file then not only will the log be updating too fast for any version of tail to cope but you log files will rapidly fill your hard drive. To configure logs you may need to learn how to use mod_rewrite and set environment variables. You won't want to log every image file from every page for example, just the main HTML content.

There are two logs at mimimum that you need to keep an eye on with others that can be added via configuration:

ERROR.LOG Highlights problems with the server, intrusions, hacking attempts etc.
ACCESS.LOG Highlights general usage patterns
REWRITE.LOG If you install mod_rewrite and have rewrite rules enabled. You can temporarily enable this to track and debug rewrite rules in real-time using Tail
SECURITY.LOG If you install mod_security into Apache or MicroApache on a public-facing webserver

Here are some great articles on the subject

Other Log-Viewers

Other useful pages

This is quite an awesome-looking log-visualiser... (Logstalgia or Apache Pong)

And this looks pretty handy too...


Page Top

Page last updated on 25 February 2021 - This page is optimised for Mozilla Seamonkey  and 1024x768 or higher screens

do not click this link