Documentation
IBILL PROCESSOR: V6.0
System Requirements
- Unix, Lynyx or NT Operating System
- Perl 5
- Apache, IIS3.0, IIS4.0, or Enterprise web
server
IIS Users
If you are installing this on an NT Server
you MUST have a program called DAF installed. Your ISP should either already HAVE
this installed or be willing to install it since it is IMPOSSIBLE to run a password site
without it. The guy that created DAF is really cool and very helpful if you are
installing this yourself. Visit his website
or email him for assistance with DAF.
Upgrading?
If you already are running IBILL processor
4.0 or earlier you CANNOT simply replace your installation with 5.0. I had to make
some changes to the database structure that I have been putting off for a LONG LONG
time.
5.0 to 6.0
Simply download the new tarball, and replace
accountcreate.cgi, search.cgi and delete.cgi. Remove restore.cgi.
older versions NT
- FIRST BACKUP THE FOLLOWING FILES from your OLD
installation and STORE THEM SOMEWHERE SAFE - backup,log,database,passwords
- Copy your old LOG and DATABASE files into your
new installation
- Upload rebuild.cgi (its in the new tar file)
into this same directory - chmod 755 rebuild.cgi
- Upload a BLANK text file called newlog into
this directory and chmod 777 this file
- From telnet or from your browser run
rebuild.cgi
- DOWNLOAD the file newlog and RE UPLOAD this
file as log (over the old file)
- Now from the new ADMIN page click on the
RESTORE LINK @ the bottom of the page to execute restore.cgi
- ALL DONE!
older versions unix
- Download the new IBILL.tar file
- Read the instructions inside of
/upgrade.tools/compile.cgi
Preliminaries
- Determine the path to PERL 5 on your web
server host. Note that some web hosting companies run both PERL 4 and PERL 5.
Make ABSOLUTELY sure you are not setting this up under PERL 4. Ask your
administrator if you are not sure.
- Download the tarfile for this program and
save it to your desktop.
- Unpack the tar archive on your desktop using a
program that unpacks UNIX TAR ARCHIVES. If you don't have such a program then download
WINZIP FREE from SHAREWARE.COM.
- After you have unpacked the TAR archive you
will have a collection of folders and files on your desktop. Now you have to do some
basic editing of each of these files (or at least some of them). Use a text editor
such as wordpad, notepad, BBEdit, simpletext, or teachtext to edit the files. These
are NOT WORD PROCESSOR DOCUMENTS they are just simple TEXT files so don't save them as
word processor documents or save them with extentions such as .txt or they will NOT WORK.
Note that there may be a some files inside of folders which are "blank".
This is normal.
Preparing the CGI scripts
Define Path To PERL 5
The first step is to open up each and every
file that has a .cgi extention and edit line number one of each script. Each of the
cgi scripts is written in perl 5. For your scripts to run they must know where perl 5 is
installed on your web server. The path to perl 5 is defined to a cgi script in the first
line of the file. In each of the cgi scripts the first line of code looks something like
this:
#!/usr/bin/perl
If the path to perl 5 on your web server is
different from /usr/bin/perl you must edit the first line of each cgi script to reflect
the correct path. If the path to perl 5 is the same no changes are necessary. If you do
not know the path to perl 5 ask the webmaster or system administrator at your server site.
Configure the .cgi files
configure.cgi
Each line of code does the following:
- Defines $date_command as the path to the date
program on your web server.
- Defines $localurl as the DOMAIN NAME of your
website
- Defines $remoteurl as the URL of internet
billing
- Defines $userdatabase as the path to the
database file in your cgi-bin/mastergate directory.
- Defines $accessfile as the path to the
passwords file in your cgi-bin/mastergate directory.
- Defines $logfile as the path to the log file
in your cgi-bin/mastergate directory.
- Defines $deleteurl as the URL of delete.cgi
- Defines $modifyurl as the URL of modify.cgi
Each line must be edited to reflect the appropriate path and URLs on your server.
File Locations
- Make a directory named mastergate inside your
ROOT HTML directory.
- Make a directory named mastergate inside your
cgi-bin directory
The following files will be uploaded into
http://yourdomain/cgi-bin/mastergate/
- configure.cgi
accountcreate.cgi
add.cgi
delete.cgi
count.cgi
- modify.cgi
- search.cgi
- passwords
- database
- log
- admin
- ALL PINCODE FILES (explained later)
The following files will be uploaded into
http://yourdomain/mastergate/
- index.html
- ALL 900.html files
The following files will be uploaded into
http://yourdomain/mastergate/admin/
- admin/index.html
- admin/htaccess (RENAMED .htaccess)
The following files will be uploaded into
http://yourdomain/members/
- htaccess (RENAMED .htaccess)
File Access Permissions
File access permissions must be set correctly
for this program to run. The table below lists the permissions of each file which are to
be set by the unix command ( chmod ) used to set the correct access permissions. You must
set the access permissions for each of these files. NT users will not have to set
permissions obviously.
CHMOD 755 |
CHMOD 777 |
configure.cgi
accountcreate.cgi
add.cgi
delete.cgi
count.cgi
modify.cgi
search.cgi |
passwords
database
log
admin
all pincode files |
Create Pincode Files
IBILL has sent you lists of pincodes (1000
per list) each with a corresponding master account and sub account number. These pincodes
must be grouped by sub account and converted to text files. The files must be labeled by
account number and then transferred to your web server.
Note: There must not be any blank spaces,
blank lines or line feed characters between the codes in these files.
Example:
A pincode file contains the sub account
number 8050100 with a list of associated pincodes.
- Create a text file with the pin codes line by
line as follows.
- 5066819
- 0853835
- 6417951
- 1367069
- 1688538
- 6560906
- 9965320
- 2356833
- 1437729
- 9289087
- 6211526
- 4327962
- etc...
-
- Save the file using the name of your subaccont
and masteraccount (example 8050100 would be for master account 8050, sub account 100)
- Do this for each sub account in each of the
pincode lists provided by IBILL.
- Using ftp upload the files to the
../cgi-bin/mastergate/ directory
- Set the permissions on the pincode files to
world r,w,e (chmod 777)
chmod
777 filename
Create .htaccess Files to password
protect directories
Important: Create these files now but don't
upload them until the entire installation is finished. .htaccess files are
password control files used by APACHE ONLY. If you use Enterprise or IIS you will
need to consult the HELP PAGE for more information
regarding password protecting directories.
You must create .htaccess files for your
admin and member directories. The .htaccess files are used by your server, in combination
with password files, to control access to the directories where your your web pages
reside. The .htaccess file in the admin directory will determine who has access to your
administrative pages. The .htaccess file in the members directory will determine who has
access to your membership pages.
- Create a .htaccess file In your
http://your-domain/mastergate/admin/ directory using the example file htaccess.example.
Note the first line of the file looks something like this:
AuthUserFile /path/to/cgi-bin/mastergate/admin
This line sets AuthUserFile as the path to
your admin password file. It must map to the path of your admin password file: ie:
AuthUserFile
/path-to/cgi-bin/mastergate/admin
- Now create a .htaccess file in your
http://your-domain/members/ directory using the example file htaccess.example.
- Assign AuthUserFile so it maps to the path of
your members password file. ie:
AuthUserFile
/path-to/cgi-bin/mastergate/passwords
Important
information for Netscape Enterprise Servers
- You will need to manually edit your htaccess
file - actually Enterprise servers don't use htaccess they use something similar called
nsconfig. Here is the basic structure
-
- <Files mastergate/secured/*>
- RequireAuth
userfile=/path/to/cgi-bin/mastergate/passwords
- realm="yourdomain.com" userlist=*
- </Files>
-
- Ask your system administrator if you need
further assistance with this.
|
Editing
mastergate/index.html - THE MEMBER SIGN UP PAGE
The index.html file in the top level
mastergate directory must be edited to supply correct information for each of your credit
card account, web 900 account or dedicated 900 account buttons.
Credit Card Buttons
Review the following lines of code from the
credit card section and edit them according to the instructions given.
<input type="hidden"
size="7" maxlength="7" minlength="7" name="ref1"
value="/path/to/cgi-bin/mastergate/8050100">
The field ref1 has it's value field set to 8050100. The value field is the account
masteraccount-sub account number of this button and must be changed to contain one of your
IBILL account numbers. In the example above I use masteraccount 8050 and subaccount 100
(8050100)
<input type="hidden"
size="7" maxlength="7" minlength="7" name="ref2"
value="30">
The field ref2 is the number of days this account is good for. You must set the value
field of ref2 to the correct number of days that corresponds to the sub account referred
to by ref1 (for recurring set to 9999999).
<input type="hidden"
name="account" value="8050100">
The value field of this line refers to the same account referred to by ref1. Set this
value field to the same account number.
<input type="submit"
value="$9.95 for 30 days by credit card">
This line contains the price and expire information as displayed to your client. Change
the value field to indicate whatever number of dollars per time this sub account
purchases.
As the comments in the index.html file
indicate you must copy and edit this section of code for each of your sub-accounts.
Web 900 or Dedicated 900 Buttons
Review the following lines of code
from the web 900 section and edit them according to the instructions given.
<input type="hidden"
name="account" value="8050500">
The field account has it's value field set to 8050500. This corresponds to the particular
web 900 account.
<input type="hidden"
name="return"
value="http://www.yourdomain.com/mastergate/8050500.html">>
The value field should be changed to contain the path of the redeem page for your 900
pincodes.
<input type="submit"
value="$9.95 for 30 days by credit card">
This line contains the price and expire information as displayed to your client. Change
the value field to indicate whatever number of dollars per time this sub-account
purchases.
Editing mastergate/admin/index.html -
THE ADMINISTRATIVE INTERFACE
The index.html file in the mastergate/admin
directory must be edited to supply the correct path to your cgi or cgi-bin directory and
to add the names of your pincode files to the selection list..
The Path to CGI
A sample form action tag is displayed
below. These tags instruct the script to engage a specific cgi file. Edit each of the four
form action tags to map correctly to your cgi or cgi-bin directory.
<FORM
ACTION="/cgi-bin/mastergate/count.cgi" METHOD=POST>
Specifying Pincode Files
The section of code displayed below produces
a select list where each selection is defined by an option tag. It must be modified so
that an option tag exists for each of your pincode files. This allows you to count the
number of pincodes in each file.
Example
- <select name="pinfile">
- <option
selected>/path/to/cgi-bin/mastergate/8050100
- <option>/path/to/cgi-bin/mastergate/8050500
- </select>
Editing webgood pages for credit cards
- upload to ftp.IBILL.com
You must create webgood pages to transfer to
ftp.IBILL.com. Use the template provided for you (g8050100.hmf) and edit as described
below. You must create ONE WEBGOOD PAGE PER ACCOUNT.
Edit Form Action
<form
action="http://yourdomain.com/cgi-bin/mastergate/accountcreate.cgi">
Edit to point to accountcreate.cgi on your
system
Name the webgood page
Rename each webgood page using the following
format
gxxxxyyy.hmf
where xxxx is your MASTER account number and
yyy is the sub account number for this particular billing method and rate. See
http://www.IBILL.com/setopcc.html for more information regarding this.
It is important that you review your internet
billing administration section very thoroughly. The information can be found at
http://www.IBILL.com/admin.htm
Be sure to edit join.html according to the
example at http://www.IBILL.com/samples/join/howtopay.html.
Editing webgood pages for web 900 - stored
on YOUR SERVER
The webgood (or redeem) pages used for web
900 numbers are stored inside http://yourdomain.com/mastergate/.
Each web 900 account will have a unique page for redeeming pincodes. For this
example we will use the FICTICIOUS account number 8050500. Use the template provided
for you (8050500.html) and edit as described below. You must create ONE WEBGOOD PAGE PER
ACCOUNT.
Edit Form Action
<form
action="http://yourdomain.com/cgi-bin/mastergate/accountcreate.cgi">
Edit to point to accountcreate.cgi on your
system
Edit ref1 and ref2 HIDDEN FORM FIELDS
<input type="hidden"
name="ref1" value="/path/to/cgi-bin/mastergate/8050500">
Edit to point to the location of the PINCODE
file for this account
<input type="hidden"
name="ref2" value="30">
Edit to be the NUMBER OF DAYS this account is
for (example is 30 days)
Name the webgood page
Rename each webgood page for your web 900
accounts using the following format
xxxxyyy.html
where xxxx is your MASTER account number and
yyy is the sub account number for this particular billing method and rate. See
http://www.IBILL.com/setopcc.html for more information regarding this.
Upload your members pay area to
http://yourdomain/members/
Add a members account for yourself
- Go to the administrative interface
http://yourdomain/mastergate/admin/ and add an account for yourself by filling out the
fields at the bottom of the page. This will add your username and password to the
MEMBERS password file.
Add an administrative password for yourself
- Now download the passwords file located inside
../cgi-bin/mastergate/passwords
and COPY this file as
../cgi-bin/mastergate/admin.
Now your members password is the same as your administrative password.
NOW upload the TWO .htaccess files
and you are FINISHED!
- You should test the system by running your
credit card through and then redeeming the charge(s) in the IBILL administrative
interface.
YOUR NEW MEMBERS SIGN UP PAGE IS HERE
http://yourdomain/mastergate/index.html
YOUR MANUAL ADMINISTRATION INTERFACE
IS HERE
http://yourdomain/mastergate/index.html
This will be used to manually overide the
AUTOMATIC password cgi scripts if needed.
NOTES ON RUNNING YOUR SITE
All passwords are refreshed EVERYTIME a new
signup occurs. Once in a while a user will have problems because they are either
confused, their computer crashes, or whatever. If that happens you can easily
create a username and password for them through the administrative interface.
You will likely NEVER need to click on the
bottom link (regenerate password databases) The ONLY time you might need to do this
is in the even that your server crashes. Out of the 500++ installations I have done
we have only had to do this TWICE. So basically you should leave this alone - it is
only for emergencies.
DATES - all dates are in a format called a
JULIAN DATE. Julian dates are NUMERICAL. 1 being Jan 1, 1991. Since
passwords are generally sold for a a given NUMBER OF DAYS the only thing that really
matters is the NUMBER OF DAYS a users password is valid - it doesnt matter what DAY it
expires. It only matters that if they bought a 30 day password - it should last at
least 30 days.
ADDING USERS MANUALLY - When and if you add
an account through the admin interface there are only THREE required fields.
Username/Passwords/Expire. Username and passwords are hopefully obvious.
Expire is the NUMBER OF DAYS for the account. Thus if you need to add someone for
834 days you would enter the number 834 in this field. The other three fields are
transaction/subscription/pincode - you will probably not feel like dealing with those
fields because you would have to look them up through IBILL
BACKUP YOUR DATABASES MANUALLY! I dont
know why this should be a surprise to anyone. Remember, even the space shuttle
exploded. The best laid plans given enough time are bound to fail. Your server
will crash someday, or you might accidentally delete your database. Regardless, you
should ALWAYS make a point of downloading the database files periodically in case of total
disaster. The files you should save are passwords, database, and log.