Adding A Counter
A counter may be added to your page to record and display the number of people who have viewed your home page. A typical counter would appear as below.
You are visitor number:



To create this counter, you have to create the counter directory within public_html, create a file to store the number of visits to your page, create a configuration file that sets all of the options for the counter, change the permissions of these files and the directory so that they can be read from the web, and put the appropriate IMG tag in your HTML document.
To add a counter:
- At the frank prompt, change to your public_html directory.
frank$ cd ~/public_html
- Create a subdirectory for the counter files under the public_html subdirectory.
frank$ mkdir counter
- Change the group to that of the web server.
frank$ chgrp httpd counter
- Change the permissions to make the directory accessible on the web.
frank$ chmod 770 counter
- Change to the new directory.
frank$ cd counter
- Create the data file for storing the number of visits to your page.
frank$ pico home.count
- Type the number you want the counter to start at (e.g. 1 or 10).
- Save the files and exit Pico.
- Change the group of this new data file to that of the web server.
frank$ chgrp httpd home.count
- Change the permissions of this new data file.
frank$ chmod 770 home.count
- Create the configuration file that sets all the options for the counter.
frank$ pico home.config
- Type in the desired options and required directory pathnames. (See Configuration Options and Sample Configurations.)
- The following line is required in this data file CountFile=/(path to your home directory)/public_html/counter/home.count where (path to your home directory) would be something like /users/group/username.
- Save the file and exit Pico.
- Change the permissions for home.config.
frank$ chmod a+r home.config
- Add the following text and tags to your html document.
You are visitor number:
<img src="http://www.mtsu.edu/cgi-bin/counter.pl? (path to your home directory)/counter/home.config" alt="counter">
Note:
Put a space after the IMG and before the ALT only.
Counter.pl is the name of the program that runs the counter.
| Index | Guide | Links | Maps | Counter | Forms | Files |