Admin Digest: Setting Up Your Own Web Server
Logging Web Traffic

Rob Reilly
Thursday, January 2, 2003 01:36:47 PM
Once you start getting some traffic on your web site you will be
asking yourself questions. What files are people getting? Which area
of the site is the most popular? What are the total number of
megabytes we transferred last month?
To answer questions of this type you need to look at your
logfiles. The server generates at least two logfiles: you can tell it
to split up the data into more. There is always an 'error' log and an
'access' log, which are located in the /var/log/httpd directory.
The error log records
attempts to get files on the server that fail. For instance if a user
makes a typing mistake then the misspelled URL will show up in the
error log.
The access log is a list of the URLs that were successfully
retrieved. Both logs contain dates, number of bytes transferred and
some information on where the request was made from. There is a
powerful program for doing this under Linux and other UNIX-derived
systems. The program is called analog. The simplest way to use analog
is to install it as a package and then type:
analog >report.html
Look at report.html with a web browser, and then play around with
analog. This program can be configured to
extract information in every conceivable way from the server's log
files.
Next: Improving Performance »