clubct2b.jpg (9764 bytes)

CHAPTER SEVEN - SSIs and Wusage


7.1) SSI

7.2) COMPLETE WEB SITE COUNTERS


7.1) SSI

All ClubCt.Com LLC servers allow SSIs. The 'SS' stands for Server-Side and the 'I' stands for whatever your consultant tells you. 'Includes' and 'interface' are both popular. (SPML -- Server Parsed Markup Language -- is also used to refer to the code you write. Really, you can learn the entire small command set SSI provides before you learn the acronyms.) Basically, SSI is a mechanism whereby you can have our server do something to your HTML before sending it to the browser. SSI does some of the same things CGI does. Some differences are that SSI doesn't handle forms (at least, I haven't seen anyone bother trying) but CGI is much more involved if you just want another file or the output of a program included in your document. To have a document parsed for SSI directives, give it the extension .shtml instead of .html. You could also make it executable if changing the filename is too much trouble. (chmod +x file.html) Formal documentation is available from within the Apache manual. The following example should show you what sorts of things are possible:

<html>
<head><title>SHTML test</title></head>
<body>
<h1>#1</h1>
Your IP address is <!--#echo var="REMOTE_ADDR"-->.
<h1>#2</h1>
This document's filename is <!--#echo var="DOCUMENT_NAME"-->.
<h1>#3</h1>
The Universal Time Coordinate is <!--#exec cmd="/bin/date --utc"-->.
Running another program makes for an example, but note
that the current time is availible like so:
<!--#echo var="DATE_LOCAL"-->.
<h1>#4</h1>
Here I include a footnote.
<hr>
<!--#include virtual="foot.html"-->
</body>
</html>

7.2) COMPLETE WEB SITE COUNTERS

See clubct.com's statistics as a simple example of what wusage will do.

7.2.1) Using wusage

Wusage is available at http://www.boutell.com/wusage/. It is a powerful count program that is run once a week. It generates web pages which include graphical representations of the amount of hits that you have received both in the past week and over time.

If you wish to save some money and disk space you can run our wusage program which is stored at /WWW/htdocs/admin/wusage7.0/wusage. This program has been specially optimized by us for faster performance. If you wish to run wusage as a cron job we would highly prefer that you give us the location of your wusage.conf file and let us run the cron job. (We'll run it sometime on Sunday, and in such a way that it won't overload the machine by running at the same time other people are doing it.) Thanks.

7.2.2) Sample wusage.conf file

The example file was used to set up world-health.net. It has been setup so that while accesses to graphic files are included in the total of accesses, they are not included in the top ten web pages hit. You can modify this example for your own use. There are only a few things to change, and plenty of comments.

7.2.3) Sample prefix.html and suffix.html files

These files are referenced by wusage.conf, and are put at the top and bottom of all reports. Here is the prefix.html we used for world-health.net:

      <HTML>
      <HEAD>
      <TITLE>World Health Net - Statistics Report</TITLE>
      </HEAD>
      <BODY BGCOLOR="#ffffff" TEXT="#0000bf" LINK="#0000ff">
      <center><IMG SRC="bk_bar.gif" alt=""><p>
      <H1>World Health Net - Statistics Report</H1>
      <IMG SRC="bk_bar.gif" alt=""><p>
      </center>

And here is the suffix.html we used for world-health.net:

     <center><IMG SRC="bk_bar.gif" alt=""></center><p>
     </body></html>

7.2.4) Explanation of cron jobs

 

cron refers to the standard Unix facility for running commands at predetermined times. For example, a crontab ('cron table') entry such as 50 1 15,30 * 5 payroll would run a hypothetical 'payroll' command at 1:50 AM on the fifteenth and thirtieth of every month, as well as every Friday. Type man crontab for how to edit your crontab and man 5 crontab for information on the format.

The reason that we wish to enter crontab entries for wusage is so that we can control the spacing of the wusage runs and avoid having ten copies running all at 12:01 on Sunday morning.


Back to the Table of Contents