Documentation
MICROCITIES:  V1.2


System Requirements

  • Perl 5
  • htaccess

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.
  • 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

microcities.cgi

Not much to edit here.  If you are planning to insert HEADER HTML you will need to pick a variable to trigger the insertion.   Thus as the browser parses the HTML you have to tell it WHEN to insert the HEADER HTML.  I prefer to use the </head> tag.

  • $headertrigger = "</head>";
  • $headertrigger is thus the HTML tag you will use to trigger the script.  As soon as $headertrigger appears the HTML HEADER appears NEXT, then the rest of the HTML.

After the rest of the HTML is finished you are able to add a HTML FOOTER.  Both the HEADER HTML and FOOTER HTML are added to microcities.cgi by simply cutting and pasting the raw html into the areas marked inside the script.  For example the HEADER HTML is done like this (HTML IS IN BLACK)

  • #########################################################
  • # PASTE HEADER HTML BETWEEN TAGS OR LEAVE BLANK
  • #########################################################
  • print <<ENDHEADERHTML;
  •  
  • <center>PASTE CUSTOM HEADER HTML HERE!</center>
  •  
  • ENDHEADERHTML
  • #########################################################
  • # END OF HEADER HTML
  • #########################################################

The footer HTML is done likewise.

Edit and upload .htaccess

  • Edit the htaccess file so it points to microcities.cgi (NOT THE FULL PATH, THE RELATIVE PATH)
  • Chmod microcities.cgi to 755
  • All done!

Using The Program

  • Anything you place inside the directories or subdirectories under .htaccess will have the HTML HEADERS and FOOTERS added to them.   If you only want to use HEADERS or just FOOTERS then obviously leave whatever you do NOT want BLANK.