fsu seal Florida State University
Systems - Webmail - Web Support - UCS Home


 

UCS > Online help

Info for New Students

Secure Shell Help
Setup SSH


eMail

Listserve

Info for New Web Sites
Building a site
Intro to FSU's web
Publishing to the web

UNIX Operating System
Lynx
:Text-only Webbrowser


FSU Computing

Policies
Data Management
and Security
Guide to Computing





University Computing Services

Scripting -- CGI, Javascript and Webcounters

UCS has made an access counter available to departmental websites on www.fsu.edu, faculty/staff pages on mailer.fsu.edu and student accounts on garnet.fsu.edu. Count is a CGI program designed to keep a record of the raw hits of a web page. It generates a GIF image of the number of hits and returns an in-lined image to the browser. Like this:


Complete information about Count, including a list of configurable features, can be found at the author's website. Please note that for security reasons some features of Count, i.e., user definable fonts and arbitrary .gif files, have not been implemented on our system.

Installing the Counter:


1. Log into your account. Change directories into your departmental account.

cd departmentaccount

... where departmentaccount is the name of your department's web account. If you are faculty, staff or a student and have a personal account on either mailer or garnet, simply cd into your public_html directory.


2. Within your public_html directory, create a new directory to hold the script (if you already have a cgi-bin directory, skip this step).

mkdir cgi-bin


3. Change directories to the cgi-bin directory.

cd cgi-bin


4. Copy Count into your cgi-bin directory.

cp /httpd/htdocs/Misc/Count.cgi .

Type the above exactly. Include the dot (.) at the end of the statement.


5. Set Permissions. If you're setting up Count in a departmental web directory you will need to wait for the automated permissions script to run before your counter will be executable. The script runs three times daily. If you're setting this up in a personal account on mailer or garnet, you will need to change the permissions of the file manually using the chmod command.

chmod 700 Count.cgi


6. The last step is to include the reference for the counter in your html document. For example:

<img src="/cgi-bin/cgiwrap/~your_username/Count.cgi?df=name.dat">

... where your_username is the name of the account (for example, ~biology or, if this is your personal account, ~jsmith) and name is some name that you give to the .dat file. The .dat file is used to keep track of the count and the last machine IP that accessed your page. This is to disallow people from doing multiple reloads to run up the counter. The name can be anything but it is recommended that you use the name of the primary web page to make the file names unique. For example, your_username1.

You may add any valid arguments to the img src tag, of course, such as align. In addition, you may change the display of the counter in various ways including, for example, changing the color of the numbers, specifying transparency, etc. For examples of how to do this see Muquit's example page.


Troubleshooting:

You MUST type the above EXACTLY. Even one misplaced character will cause the script to fail.

Most people who can't get Count to work are really having trouble with CGI-Wrap. Check here for more information on running CGI programs on UCS systems, including a list of common error codes.

More information about the Unix shell commands above can be found in the onLine Unix Manual.


***** If you need additional help, please see our list of help resources. Please NOTE: The Technology Services Help Desk will NOT help students with websites related to coursework.