Simple Visitor Counters
Counters, counters everywhere! It seems that the hit counter is just about
as ubiquitous as the web itself! Two simple counters (one text and one graphical)
are presented in three sections below.
You do not have to use a counter to track your web site's visitors.
Your server logs keep an accurate record of your site visitors.
To learn more about server logs, check out our special
help section on site statistics.
To Install the CGI source files, telnet
or SSH to your Virtual Server and enter the following:
To configure the counters, do the following.
- Configure your Virtual Server to recognize server
side includes. Create a file called .htaccess
in the same directory where the HTML with the server side include is
to reside. The .htaccess
file should look like:
FollowSymLinks Includes ExecCGI
AddType text/x-server-parsed-html .html
You can either use Pico to create the file on your Virtual Server
or you can create it locally on your own PC (in TextPad,
for example) and then use a FTP client to upload it to your Virtual
Server (in ASCII mode). Either way will work.
- Initialize your counter with a start value. This start value
allows you to start a counter at a higher number than zero so that it
appears many more visitors have come to your site.
To do this, create a file with the same "basename" as your .html
file that you plan to put the counter on, but with the extension .count,
rather than .html. For
example, for index.html,
you would create a file by the name of index.count.
Put this file in the same directory as index.html.
You can create the .count
file locally on your own PC (using "notepad", for example) and then
use an FTP client to upload it to your Virtual Server (in ASCII mode).
Or you can do this while connected to your Virtual Server by doing the
% cat > index.count
0 ^D (the control-D character)
Include something like the following in the main body of your HTML document:
your web page and see if it works. Once you have completed the installation
successfully, you will have a working counter like the one shown below.
Internet Customers Served.
You have the flexibility of specifying a Graphical
Counter Digit Set to be used to display the count if you are using
the graphical counter. Refer to the instructions within the counter code
itself for more information.
The textual based counter, c4.pl, is written
by Jonathan Lewis. The graphical based counter, c4g.pl,
is simply a modification of the textual counter- modifications were made
by Scott Pierce.
If you are unfamiliar with the CGI standard, or would like to learn more
about the Common Gateway Interface, the following URL is an excellent resource: