Scintilla's WWW Access Counter

Version 0.94

Contents

Read this first

This documentation is intended for local users (members of Scintilla) only or can be used if this counter software is installed on another server. Scintilla has not the policy (and the power) to support counters for pages from other servers, since this server is already severely overloaded. So unless someone kindly donates a Sun Sparcstation, only pages of this server will be counted.

What does it do?

This counter counts the number of accesses to a certain page. This is done by refering to a program in /cgi-bin/(usually called script) which increases the counter and returns a picture of the current value. So each access to a HTML page results increases this counter.

How do I use it?

If you want to count accesses to your homepage, you simply have to include a reference to:
< IMG SRC="/cgi-bin/nph-count" >
and create file named counter.cnt This file should containt the value "0" and it should have read and write permission for the deamon running this program.

If you want to count other pages, you have to specify the name and location of the counter, such as in:
< IMG SRC="/cgi-bin/nph-count.gif?PATH/FILE" >, with
PATH=the path within the WWW space and
FILE=the filename of the counter without extension
For security reasons, the extension ".cnt" will be added to the filename. This ensures that no other files than files with extension ".cnt" will be written to.

Only alphabetic characters (both capital and lower case), digits and the '/', '_' characters are allowed. All other characters are ignored.

Advanced options

All the advanced options must be put in the counterfile after the line with the counter value. The counterfile will look as follows:
43
option1=value1
option2=value2

Automatic reset

This counter is able to reset automatically each hour, day, week or month. This is done be adding the following line to the counterfile:
reset=h
In that case the counter will be reset every hour. Before the reset the current value will be added to the counter file, to be used in statistics.

Netmasking

To filter out some hosts which accesses are not to be counted, you can add a netmask. This is done by adding the following lineto the counterfile:
netmask=130.89.30.9?
In that case all hosts from Scintilla (130.89.30.90 through 130.89.30.99) will not increase the counter. These hosts will increase a second counter.

Advanced commandline options

After the counterfile name the following options can be used:
NOCOUNT
The counter will not be increased. This option can be used to display a counter on one page and increase it on another.

HIDE
The counter will be increased (if NOCOUNT is not used), but the picture of the counter will not be shown.

MASKED
The secundary counter will be shown, so all the accesses which are filtered out with netmask will be shown.

STATS
A graph of the accesses will be shown. This option must be used together with automatic reset, since only then statistic data will be acquired.

DEBUG
Debug information will be shown. This option is for testing only!

TEXT
With this option nph-count does not return a GIF picture, but it returns it's output in text.

Examples

< IMG SRC="/cgi-bin/nph-count?~frank/count" > Will access "~frank/count.cnt" and increase it.

< SRC="/cgi-bin/nph-count?~frank/count+NOCOUNT" > Will access"~frank/count.cnt" and not increase it.

< SRC="/cgi-bin/nph-count?~frank/count+MASKED+NOCOUNT" > Will access"~frank/count.cnt" and show the masked accesses and not increase it.


< IMG SRC="/cgi-bin/nph-count?~frank/count+STATS+NOCOUNT" > Will show the statistic of the last 30 days.

Source code

The source code of "nph-count" is written in GNU C++. The counter utilises an adapted version of the GIFSave(10K) functions written by Sverre H. Huseby. The source: "GIFSave.zip"(13K) is on this server available.

The counter currently runs under Linux and the CERN http deamon, but it can be compiled on most Unix systems. The deamon must have write access to the counter files since "nph-count" runs under this deamon and must be able to change the contents of the counter files.

The executable must placed in the "cgi-bin" directory, which normally requires root access to the system (although some servers do allow users to have their own cgi-bin scripts).

The source code(28K) of nph-count version 0.94 is now availabe!

More information?

If you have more questions about this counter, or are interested in the C source, please don't bother to hesitate and send a mail to Frank Cremer.


March 28th 1996 Frank Cremer