I am trying to install a cgi on our server.  Currently we are running 
OS 9.2.2, webstar 3.0.2 and filemaker 4.1 to serve our files and meet 
our database needs.  The purpose of the cgi script I am installing is 
to track the activity of our ads that we may publish on the web. It 
is called adtrackz.  It was obviously written for a regular *nix 
server but I am trying to get it to work on our mac server using 
macperl.  Here are his instructions for setting it up along with what 
I did (my notes are preceded by "%%%%%":

INSTALLATION INSTRUCTIONS

I have designed this to be relatively easy to install.  There are
only 3 files.

After unzipping adtrackz.zip you should have:

config.cgi
t.cgi
adtrackz.cgi
install.txt
license.txt

Follow each step carefully, double checking as you go and
everything should work fine. Installing a cgi script isn't
hard... it just takes delicate work and a bit of patience.

%%%%%Was able to extract the files with stuffit with no problems.

IMPORTANT!
When editing the .cgi files, you must use a basic text editor
such as notepad. Programs like WordPerfect or Microsoft Word will
add unnecessary hidden characters to the text and it will corrupt
the cgi files. If you accidentally corrupt a file, you can
download a fresh copy of Adtrackz.


#####################################################
# STEP 1:       PATH TO PERL
#####################################################

First, change the path to perl in each file. This is the first
line and it looks something like this:

#!/usr/bin/perl

Your host should have information on your path to perl on their
webpage somewhere.

%%%%%After wracking my brain for a few hours I found out I did not 
have to do this with my mac and MacPerl I read somewhere that I was 
just supposed to open each script with MacPerl and save it as a cgi 
script, which I did.

#####################################################
# STEP 2:       DIRECTORIES
#####################################################

Now, create the directories on your server.

You must create a directory in your cgi-bin (or any directory
that can execute cgi scripts). I called mine a, but that's just a
suggestion.

ex:  cgi-bin/a

Next, create another directory within a (or whatever you called
it). This is the data directory.

Ex: cgi-bin/a/data. 

Make sure to remember the full server path to this directory as
you will have to enter it in config.cgi.

You might need to create a blank index.html page and upload it to
both the a and data directory.  You must create the index file
AFTER you run Adtrackz at least once. The data directory has to
be empty when Adtrackz runs for the first time.

The index file is to stop people from snooping around on your
server.  Your host should really set permissions so that people
can't do that, but some of them don't.

An easy way to check if you have to do this is to simply type the
url to a directory in your cgi-bin.
ex: http://www.adtrackz.com/cgi-bin/a/
if you get a "Error 403 Forbidden", then you don't have to worry
about the index file.

%%%%%In the WebSTAR folder there was a folder called "cgi-bin" and it 
was empty (we've never used cgi's before on this server) so I created 
a folder inside "cgi-bin" called "a" and inside the "a" folder I 
created a folder called "data".  At the moment Im not too worried 
about the blank index page bit.  So far I seem to have done 
everything correctly.

#####################################################
# STEP 3:       EDIT YOUR VARIABLES
#####################################################

Now you have to edit config.cgi. There are only a few variables,
let's take them one at a time.

$datapath =  "/usr/www/something/httpd/cgi-bin/a/data/";
Enter the full server path to the data directory on your server.
The script needs to know where this is to work correctly.

$home = "/usr/www/something/httpd/htdocs/";
This is the full server path to your home directory. In other
words, the *server* path to http://www.yourdomain.com.

$tcgi = "http://www.domain.com/cgi-bin/go/t.cgi";;
This is the www path to the location of your t.cgi file.
All 3 .cgi files will be located in your a directory (or
whatever you called it).

$domain = "yahoo.com";
This one is easy. Just enter your domain without the www, just
like you see it there.

$password = "adtrackz";
Choose a password. This is used for security reasons.
It has to be 10 characters or less.

%%%%%Now here is where it gets a little tricky.  The following 
section enclosed in % symbols is the part of config.cgi that I was 
supposed to edit with the data that I put in there.  The hard drive 
is called "WebServer" and the "WebSTAR" folder is in the main 
directory .

%%%%%%%%%%%%%%%%%%<CONFIG.CGI>%%%%%%%%%%%%%%%%%%%%
#Enter the required values for each variable below.
#Be careful not to change anything else,
#just what's in between the quotes.

#The server path to the data directory, must end with a /
$datapath =  "/WebServer/WebSTAR/cgi-bin/a/data/";

#The server path to your home directory, must end with a /
$home = "/WebServer/WebSTAR/";

#full www path to t.cgi
$tcgi = "http://www.investorsleague.com/cgi-bin/a/t.cgi";;

#your domain, simply enter it without the www's,
$domain = "investorsleague.com";

#enter a password, max 10 characters
$password = "adtrackz";
%%%%%%%%%%%%%%%%%%</CONFIG.CGI>%%%%%%%%%%%%%%%%%%%%

%%%%%originally I put the password to our webserver in the last part 
where it asks for a password.  but I think it is just a password to 
log into this little ad tracking system from the web.

#####################################################
# STEP 4:       UPLOAD THE FILES
#####################################################

Ok, now all you have to do is upload all 3 cgi files to your a
directory (or whatever you called it).  Make sure to chmod them
to 755.

Run adtrackz.cgi. It should prompt you for your password.

%%%%%I have no Idea what "chmod" is or what I'm supposed to do with it.

#####################################################
#       TROUBLESHOOTING
#####################################################

If you are 100% sure that you have set all the permissions right,
and all the paths are ok and you are still having problems, try
chmoding the data directory to 777.

Another common problem is sometimes people create the index.html
file in the a and data directory before running Adtrackz at least
once. See Step 2.

If you are still having problems, contact me at
[EMAIL PROTECTED] and I'll be glad to help.

%%%%%%%%%%%%<END INSTALATION INSTRUCTIONS>%%%%%%%%%%%%

As for the troubleshooting section, still no idea what chmoding is 
and there is nothing in the "data" directory and only the 3 cgi's in 
the "a" folder.  So after I set all this up like this I try to load 
adtrackz.cgi from the web with the address 
http://investorsleague.com/cgi-bin/a/adtrackz.cgi and I get this in 
my web browser:

Diagnostic Output
# config.cgi did not return a true value.
File 'WebServer:WebSTAR:cgi-bin:a:adtrackz.cgi'; Line 30
# BEGIN failed--compilation aborted.
File 'WebServer:WebSTAR:cgi-bin:a:adtrackz.cgi'; Line 30

So from this I checked out adtrackz.cgi and found 28 lines of 
disclaimer (this is a paid copyrighted product which is why im only 
showing bits of the code), an empty line and then on line 30, this 
began:

%%%%%%%%%%%%%%%%%%<ADTRACKZ.CGI>%%%%%%%%%%%%%%%%%%%%

BEGIN { require "config.cgi"; }
use vars qw ($datapath $home $tcgi $domain $password
  $idfile $campaigndata $campaigntypes $badhits $errors $initurl);

  BEGIN
{
        use CGI::Carp qw(carpout fatalsToBrowser);
        open(LOG, ">>$errors") or die("Unable to open $errors: $!\n");
        carpout(LOG);
}

use strict;
use CGI;
use Time::Local;
use Fcntl ':flock'

%%%%%%%%%%%%%%%%%%</ADTRACKZ.CGI>%%%%%%%%%%%%%%%%%%%%

So now here I am and I really don't know what to do to make this 
work.  Can anyone see anything that  I am doing wrong?  I appreciate 
all help.

Reply via email to