C Hit Tracking Software


AutoRank Pro includes C versions of the in.cgi and out.cgi Perl scripts that are used by default. The C versions are useful for very high traffic sites that need top performance from the hit tracking scripts. Depending on your server configuration, using the C versions of the hit tracking scripts can double or even triple the amount of traffic your server can handle. This document will describe the requirements and method for setting up the C versions of the hit tracking scripts.


In order to use the C versions of the hit tracking scripts you will need shell access to your server and access to a C compiler. We recommend using gcc as your compiler if it is available on your system, as that is the compiler we use for testing. You will also need access to cron on your server so you can rebuild the pages, reset the hit counts, and clear the IP logs automatically. The C versions of the hit tracking scripts are not capable of doing that on their own, so you need to use cron to do that.

Important Notes

When using the C version of the in.cgi script you need to be aware that the Cheat Protection Options in the Edit Options interface of the control panel will no longer have an affect. To make changes to your cheat protection options you will need to modify the settings in the in.c file and recompile it. The C version of the in.cgi script does, however, use the same gateway page template as the in.cgi Perl script so you can modify it exactly the same as you would if you were using the Perl version of in.cgi.

Configuring the in.c Source File

Included in the AutoRank Pro distribution is a directory named src. Inside this directory are the C source files that you will need to compile on your server. You should find three files named cgi.h, in.c and out.c. Before you can compile the C source files you need to configure the in.c file. This C source file has several settings that affect the cheat protection levels that it uses. You can open the in.c file in a text editor - we recommend EditPlus for Windows users. Near the top of the file you will find several variables that need to be set. A description of each is listed below. Once each of these values has been set, you can save the in.c file and you are ready to continue with the next step.

Compiling The Source Code

You are now ready to compile the C source files on your server. You can upload the three source files mentioned in the previou step to your server in ASCCI mode to the same directory as the arp.pl file. Next you will need to login to your server through SSH or telnet and change into the directory where you uploaded the C source files. To compile the C source code use the following two commands:
    gcc in.c -o in.cgi

    gcc out.c -o out.cgi
The first command compiles the in.c source file into an executable program named in.cgi. The second command compiles the out.c source file into an executable program named out.cgi. If you compiled the C source files in the same directory as the arp.pl file they will have overwritten the existing Perl versions of the in.cgi and out.cgi files.


Once the C source files have been compiled you should test them to make sure they are functioning correctly. Simply send a few test hits to make sure that the C versions of the in.cgi and out.cgi scripts are sending you to the correct URL and are counting hits. If there is a problem you can simply download a new copy of AutoRank Pro and replace the in.cgi and out.cgi compiled C programs with the default Perl versions.

Setup Cron

The last thing you need to do is setup cron so the pages will rebuild, the hit counts will reset, and the IP logs will be cleared. Setting up cron is covered in the Using Cron For Updates and the Account Scanner section of the software manual.