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.
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
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.
Set this value to 1 to enable the gateway page or 0 to disable the gateway page.
This is equivalent to the 'Enable the gateway page for incoming clicks?' option in the Edit Options interface.
Set this value to 1 to only allow browsers that support cookies to send hits or 0 to allow any browser to send hits.
This is equivalent to the 'Only count clicks from cookie enabled browsers?' option in the Edit Options interface.
This is equivalent to the 'Track incoming clicks using cookies?' option in the Edit Options interface.
Set this value to 1 to reject hits coming from proxy servers or 0 to allow hits coming from proxy servers.
This is equivalent to the 'Do not count hits coming from proxy servers?' option in the Edit Options interface.
Set this value to 1 to track hits using IP addresses or 0 to not use IP addresses for tracking hits.
This is equivalent to the 'Track incoming clicks using IP addresses?' option in the Edit Options interface.
Set this value to 1 to send surfers to the category ranking page of the site they came from or 0 to send them to the FORWARD_URL.
This is equivalent to the 'Forward surfers to the category ranking page of the site they came from?' option in the Edit Options interface.
Set this value to 1 to enable the cheat log or 0 to disable the cheat log.
This is equivalent to the 'Keep a log of suspected cheating attempts?' option in the Edit Options interface.
After this amount of seconds the gateway that the surfer is viewing will no longer be valid. Any clicks on the gateway page link after it has
expired will not be counted. This is equivalent to the 'Gateway Expiration' option in the Edit Options interface.
After this amount of seconds the cookie set by AutoRank Pro will expire and the surfer will be allowed to register a hit for an account that they
have already registered a hit for. This is equivalent to the 'Cookie Expiration' option in the Edit Options interface.
Use this option to let the software know what file extension you are using for your category pages.
This is equivalent to the 'Categories Page Extension' option in the Edit Options interface.
The full URL and filename of the incoming hit tracking script.
This is equivalent to the 'In URL' option in the Edit Options interface.
The URL where you want your ranking pages to be stored.
Do not include the actual filename, just the directory.
This is equivalent to the 'Ranking Pages URL' option in the Edit Options interface.
The URL where surfers should be sent after clicking through the in.cgi script.
This is equivalent to the 'Forward URL' option in the Edit Options interface.
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.
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.