Performing Log Analysis


It is important to always watch Web site logs, as they can reveal information about computers accessing your site, such as the pages visited, the time spent on each page, the IP address of the requesting computer, and so on. There are two main logs to view, the Access log and Error log.

Apache Log Analysis

Log analysis provides you with lots of information about how your Web site is being used. From the logs, you can gather and report information on the number of requests, the number of visitors, the number and names of the pages requested, and much, much more.

Log analysis is performed by processing the Apache access log. The information stored in the log is aggregated in many ways to be able to provide valuable statistics. It's even possible to use the logs to track a visitor's path through your Web site. This information can be very useful in determining whether your Web site is supporting your organization in a valuable manner.

While log analysis is outside of the scope of this book, the Internet is full of information on log analysis. Do a Google search for "Apache log analysis." Several products (both free and commercial) are also available:

  • Wusage One of the more popular pieces of Web analysis software

  • AWStats A free, Web-based, open source log analysis tool: awstats.sourceforge.net

  • Webalizer Another free, Web-based log analysis tool: www.mrunix.net/Webalizer

  • Urchin A very popular commercial log analysis suite: www.urchin.com


To enable log analysis

1.

Follow steps 12 in the "To add a Web site" task earlier in this chapter to navigate to the screen shown in Figure 9.3.

2.

Click the Logging tab to display a new set of logging options (Figure 9.9).

Figure 9.9. The main Web service log setup window.


3.

Click the "Enable Access log" check box.

4.

To archive the access log, select the "Archive every 7 days" check box and set the number of days between archives.

It's always a good idea to save the log files for later analysis, even if you do not care to review the information now.

5.

Enter the path to the log file in the Location field.

The default location is appropriate for most implementations, and you should not change the location of the access log.

6.

Use the Format pop-up menu to select from several predefined legacy options for the format of the access log.

or

Click the question mark next to the Format string field to display information about these options.

7.

To archive the error log, click the "Archive every 7 days" check box and set the number of days between archives in the Error log section of the screen.

The error log is always enabled for obvious reasons.

8.

To change the location of the error log, enter the path to the log file in the Location field.

The default location is appropriate for most implementations.

9.

Use the Level pop-up menu to select the level of the error information that will be stored in the log (Figure 9.10).

Figure 9.10. The various levels of error log reporting.


The default level of Warnings is adequate for most implementations.

10.

When you've finished making changes, click Save.

Apache Access Log Formats

While Server Admin provides you with a few legacy access log file formats, you will likely find that the defaults available leave your log analysis wanting. Most log analysis programs can work with one of the predefined formats, but you can get better reports by adding additional logging information to your logs.

Also, most log analysis programs will provide you with a recommended log format string. You can enter it in the Format string entry field in Server Admin (shown in Figure 9.10).

For example, you could use this log file format:

%h %l %u %t "%r" %>s %b %v "%{Referer}i "%{User-Agent}i" "%{Cookie}n 


One important note here is that the above string includes a reference to the User Tracking Cookie that is provided by the Apache Usertrack Module.

For complete information on the Apache access log file formats, visit httpd.apache.org/docs/1.3/logs.html.





Mac OS X Server 10. 4 Tiger. Visual QuickPro Guide
Mac OS X Server 10.4 Tiger: Visual QuickPro Guide
ISBN: 0321362446
EAN: 2147483647
Year: 2006
Pages: 139
Authors: Schoun Regan

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net