ipcounter 3.34

download links

Please note that from version 3.30 there is an option for the script to create a new log file each year or month.
Because of this, I am recommending that a sub directory be created in the cgi-bin to store the log files in rather than using the cgi-bin itself.
Also the names of the logs files have changed slightly, e.g.
ipcounter.pl.log is now ipcounter.log

From version 3.33 the script is only checking date and IP not Host, but there is an option to log the Host address if you wish. Also there is no reset button, if you need to clear the log just delete the log file and the script should create a new one.

ipcounter is a Perl script written for a Unix host.

The counter logs the IP address of visitors and only records them if that IP has not visited the site previously that day. I think this gives a reasonable idea of how many actual visitors have visited the site. You can put the counter on every page of the site and it will use the same log file.

The first line of the Perl script should point to your Perl interpreter, e.g. #!/usr/bin/perl

The only variables that need to be changed are in the define variables section.
The referers array should be set to your domain, e.g.
@referers = ("yourdomain.com");

If you have more than one domain you can add them as follows
@referers = ("yourdomain1.com", "yourdomain2.com");

The password should be changed to one of your choice.

Create a sub folder in your cgi-bin and chmod 777. The log file variable should point to this.

Upload the script and make sure that it is executable.

The log date variable allows you to specify how often the log files are create.
"once" = only one log file will be used
"year" = a new log file will be created each year.
"month" = a new log file will be created each month

The log host variable gives you the option of recording the Host as well as the IP address.
This will only work if DNS lookups are enabled on your server or ISP.
The options are "on" or "off"

ipcounter currently runs invisibly on 2 web sites I created for my Church. www.totalfaith.org.uk and www.totalhealth.org.uk

I recommend using invisible counting on each page.

invisible counting, e.g.
<img src=/cgi-bin/ipcounter.pl width=1 height=1>

You may want to have a login link on your site or you can enter the address manually to log in.

login link, e.g.
http://yourdomain.com/cgi-bin/ipcounter.pl?login

Once you have logged in you can see the statistics for the months, years and the total count (total unique IP addresses per day).

You can use the refresh button to refresh the statistics for the current month or to view a previous month.
You need to enter the password each time you want to use the refresh button.
The month format should be NNNN/NN e.g. 2001/01
Leave this box blank to view the statistics for the current month.

For visible counting you will probably need to change the extension on your page to .shtml to enable SSI, you may need to check with your ISP for details.

visible counting (requires SSI), e.g.
<!--#include virtual="/cgi-bin/ipcounter.pl" -->

ipcounter is not a commercial script, perhaps someone will take the idea and make a better one, however it serves my purposes and gives me an idea of the actual visitors to my sites.

The script uses file locking, and should be fairly robust.

If you have any comments, suggestions or find any bugs please Email Me

(Please note that if you are working in windows and uploading to a Unix server you may need an editor that supports Unix format as a Unix new line is different from a new line in Windows. However this should not be necessary, as you should be able to change your variables without entering any new lines.)

Rate ipcounter at The CGI Resource Index
Demo - enter 'password' to log in
Download ipcounter 3.34