Frequently Asked Questions (FAQ)
about
WWW-page Access Counter

Version 1.2
Release date: September 1, 1995
Author: Heini Withagen, heini@w4.nl


Installation
  1. Where can I find the most recent version of the FAQ and the software ?
  2. Compilation under which operating systems is possible ?
  3. Which WWW-server software is required ?
  4. Successful compilation but no image in my pages. What's wrong ?
  5. What should I specify as CGIBIN_DIR in the Makefile ?
  6. Why does the resulting binary start with the 'nph-' ?
  7. Can I edit the 'count_file' with a normal text editor ?
  8. Do I need to do anything special when upgrading to the current version ?
Usage
  1. Which arguments are accepted by the program ?
  2. What to add in a HTML-page ?
  3. How to keep track of a page without anybody knowing ?
  4. How to reset a certain counter to zero ?
  5. Can people from the rest of the Internet (ab)use the counter ?
  6. What's the size of the resulting output image ?

Installation
  1. Where can I find the most recent version of the FAQ and the software ?
    Both the FAQ and counter software package can be found at http://www.dhp.nl/commercial/software/counter/index.html
  2. Compilation under which operating systems is possible ?
    Successful compilation under the following operating systems has been achieved:
    • Linux 1.1.58 with cc and gcc 2.5.8
    • SunOS 4.1.3 with gcc 2.6.3 (cc will not work)
    • Solaris 2.4 with gcc 2.5.6
    • IRIX 5.3 with cc and gcc 2.6.3
    • HP-UX A.09.01 with cc and gcc 2.6.0
  3. Which WWW-server software is required ?
    The counter software should work with any WWW-server package which supports CGI-scripts like NCSA httpd, CERN httpd, Netsite, and many more.
  4. Successful compilation but no image in my pages. What's wrong ?
    The two most common errors in this case:
    • The read/write permissions on the count_file are wrong.
      The location of the count_file is specified in conf.h. The file which is specified there should be writable by the userid under which the WWW-server is running. Most common is that the server is running under the userid of nobody.
    • The nph-count binary is installed in a directory where it's not possible to execute CGI-scripts. Check with the question on CGI-directories for more information.

    An on-line debugging tool is now incorporated with the counter software. If the counter binary is installed in a directory from which it is possible to execute CGI-scripts try the following by directly opening the URL:
    http://localhost/cgi-bin/nph-count?link=dummy&debug=ON
    The returned HTML-page should provide additional information about possible sources of errors.

    Error messages from the program are also logged to a location of your liking. Specify in the 'conf.h' where the messages should go.

  5. What should I specify as CGIBIN_DIR in the Makefile ?
    In most cases it is best to specify the global cgi-bin directory as the place to install the binary. This system administrator usually only has access to this place.
    However, if you are a user on a system and you would like to install the package in your local directory on the server, you have to make sure that it is possible to execute CGI-scripts in user-directories on your server (in most cases this is disabled; check with your system administrator). If it is possible to do that, most probably the binary has to have the extension .cgi. Just copy the resulting binary to nph-count.cgi.
  6. Why does the resulting binary start with the 'nph-' ?
    Some WWW-server packages have problems when a CGI-script produces a GIF-picture as an output. The server parses the output of the CGI-script to determine what the header of the return message should be. To prevent the server from doing this you have to start the name of the CGI-script with 'nph' which stands for no parse header.
  7. Can I edit the 'count_file' with a normal text editor ?
    You shouldn't edit the 'count_file' yourself. In most cases, it will become corrupt and all other counters in the file might be reset.
  8. Do I need to do anything special when upgrading to the current version ?
    If you already have a previous version of the counter software running be carefull during installation of the current version. You will have to make sure that during the installation the nph-count binary is not called. This can best be achieved by disabling the WWW-server for some time (try to minimize this as your server will not be accessible during that time).

Usage
  1. Which arguments are accepted by the program ?
    The following arguments are currently recognized:
    • width=number
      Specifies the number of digits in the resulting image.
    • link=URL of the page on which the counter is located
      The link-argument is used to keep track of a certain counter. It should be unique for each counter. A good choice is the URL of the page on which the counter image is located.
    • increase=number; default 1
      Specifies the number by which the counter should be increased. This can be used to check how many times a certain page was visited without increasing the counter. In that case specify increase=0.
      Resetting a certain counter is also possible this way by specifying a negative number here.
    • show=NO
      In case you would like to keep track of the number of accesses to a certain page without showing the counter image, specify the above argument.
    • debug=ON
      The above is a special argument which can used to check the correct working of the software. You should NOT specify this argument inside a HTML-page. Instead it should be used directly by calling the nph-count program from the 'open URL' window, present in most WWW-browsers, using something like the following:
      http://localhost/cgi-bin/nph-count?link=dummy&debug=ON
      This will return an on-line generated HTML-page giving information about possible problems with the installed counter software.
    • font=number
      You can utilize many different fonts with version 1.2.1 of counter. You do so by including the font argument with the value of the font you want to use. Counter is distributed with 42 different fonts to select from. An example of each of these fonts is located here.

      You can add your own set of digits by creating a collection of digit gif files with the format "Fx-d.gif" where "x" is the font number, 43ff; and "d" is the digit number (0-9). You then run the gif file though giftogd to create a new gd file that is used by counter. Place the gif and gd files in the image directory specified in conf.h with PIC_PATH.

    • mag=number
      You can increase or decrease the actual size of the counter digits by using the mag= argument. The default size of a character is 15x20. The mag value you enter is added to this 15x20 dimension. A negative mag value will decrease the dimensions of the counter digits. You can look at examples of how to use the font and mag arguments in this Washington State University help file. However, these examples are specific to WSU and may not be entirely applicable to you.
  2. What to add in a HTML-page ?
    To activate a counter in a certain HTML-page add something like the following:
    < IMG SRC="/cgi-bin/nph-count?arg1=value1&arg2=value2&arg3=value3">
    where arg1,2,3 are any of the supported arguments.
    NOTE: do not specify the debug argument inside a HTML-page.
  3. How to keep track of a page without anybody knowing ?
    In the page you would like to monitor insert something like the following:
    < IMG SRC="/cgi-bin/nph-count?link=link_arg&show=NO">
    and on a different HTML-page where you would like the check the counter regularly:
    < IMG SRC="/cgi-bin/nph-count?link=link_arg&increase=0">
  4. How to reset a certain counter to zero ?
    If you would like to reset a counter to zero, check the counter value and the link argument you used in a HTML-page and open the following URL directly (i.e. by typing it in, in the 'open URL' box):
    http://localhost/cgi-bin/nph-count?link=link_arg&increase=-value
    This will reset the counter to zero (note: the counter value can not go negative).
  5. Can people from the rest of the Internet (ab)use the counter ?
    With version 1.2.1 of counter, you now have the option of filtering who can add a counter to your server. By default, all hosts can add a counter. If you want to restrict this to one domain, you can use the REALM_THAT_CAN_ADD parameter in the conf.h file and recompile counter. For example, you could tell counter to only allow counters to be added from the domain ".wsu.edu" by entering in conf.h:

    #define REALM_THAT_CAN_ADD ".wsu.edu"

  6. What's the size of the resulting output image ?
    The program will return a GIF-image of 20 pixels high and 15 * width pixels wide. This can used to your advantage by specifying the HEIGHT and WIDTH inside the HTML-page. By doing this, during retrieval of the page, the WWW-browser can allocate space for the image while displaying the remainder of the page.
    Example:
    < IMG SRC="/cgi-bin/nph-count?width=5&link=dummy" WIDTH=75 HEIGHT=20>

ęCopyright, 1995. All rights reserved
Heini Withagen
W4 Consultancy
heini@w4.nl