Documentation
MICROSEARCH: V6.0
Preleminary Material for review
System Requirements
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.
Before you begin
Take a
walk through the demo. The demo is layed out pretty nice to give you a good idea
of how this works.
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.
Create Directories/Upload files
Create a directory inside your cgi-bin called
microsearch (/cgi-bin/microsearch). Create another directory inside of this called
"generated" (/cgi-bin/microsearch/generated). Inside your webspace create
a directory called microsearch (http://www.yourdomain.com/microsearch) and also another
directory called admin (http://www.yourdomain.com/microsearch/admin). Upload as
follows
/microsearch/
/microsearch/admin/ (password protect) - note that if you cannot run cgi outside of the cgi-bin you may need to move
these files into the cgi-bin, nevertheless you want this directory password protected
- copy of search.html (rename index.html and
point form action to admin.cgi)
- admin.cgi
- configure.cgi (copy of configure.cgi from
/cgi-bin/microsearch)
- delete.cgi
- generate.cgi
- modify.cgi
- setup.html (points to generate.cgi)
this is where you start
- I.E. START HERE
http://www.yourdomain.com/microsearch/admin/setup.html
- I.E. START HERE
http://www.yourdomain.com/microsearch/admin/setup.html
- I.E. START HERE
http://www.yourdomain.com/microsearch/admin/setup.html
/cgi-bin/microsearch/
- add.cgi
- configure.cgi
- footer.html
- header.html
- profile.cgi
- search.cgi
- setup.cgi
- create a folder called generated inside here
too (/cgi-bin/generated) this will just be a temporary directory used during the
installation. chmod this directory to 666 or 777. After the initial setup
process this will contain the database.sql file, the add.html file, and the search.html
file.
Set all the .cgi files permissions to 755.
Set everything else to 777 or 666 depending on what your ISP requires. Chmod
the "generated" directory to 666 or 777.
Configure the .cgi files
configure.cgi
There are 2 configure.cgi files but they are
identical. So just edit one and upload 2 copies (to /microsearch/admin/ and
/cgi-bin/microsearch) Edit the cgi configuration variables - just a bunch of paths, uri's
and mysql user/pass/database name. Should be pretty obvious. Note that the
variables with /path/to/generated/ are paths to the "generated" directory you
created to store the search.html, add.html and database.sql files that are created during
setup.$headerhtml =
"/path/to/header.html";
$footerhtml =
"/path/to/footer.html";
$mysqldatabase= "your mysql
database name";
$mysqlusername = "your mysql
user name";
$mysqlpassword = "your mysql
password";
$sqlfilename =
"/path/to/generated/database.sql";
$registrationfilename =
"/path/to/generated/add.html";
$searchfilename =
"/path/to/generated/search.html";
$cgidir =
"/cgi-bin/microsearch";
$admincgidir =
"/microsearch/admin";
Cosmetic adjustments. You can customize
the colors, fonts/etc for the search engine results by tweaking these variables. The
only thing I should probably explain are the "fieldwidth" variables. These
control the table width for the fields displayed in the search results. If you want
to customize these it can help make the search results look nicer. I have this set
by default to 25%. So if your search results have lets say 5 fields you could set
this to 20% so they are all evenly spaced. This isn't necessary though.$headerfonttype= "Arial";
$headercellcolor =
"#000000";
$headerfontcolor =
"#FFFFFF";
$datafonttype = "Arial";
$datacellcolor = "#FFFFFF";
$datafontcolor = "#000000";
$fieldwidth = "25%";
$overallwidth = "100%";
$bgcolor = "white";
Setting up the database
I assume you already know mysql. If you do not you need to readup on it here.
When you get everything installed go to http://www.yourdomain.com/microsearch/admin/setup.html.
This is a simple one-field form asking
you how many fields you are going to need for your database. Play with it a little
and you will figure out how this works. There are instructions on the following page
that explain how the setup of the database works. The setup procedure creates the
.sql file for mysql and the search.html and add.html forms for adding and searching the
database. These 3 files are created and stored inside of the folder you created
called (generated). You will have to copy these 2 forms to your hard drive and
reupload them wherever you want the search.html, add.html forms to be. Also make a
second copy of search.html and put it inside of your admin directory. Point the form
action for the admin copy to admin.cgi instead of search.cgi. This special search
form will allow you to delete data. You should password protect the admin directory
if you haven't already figured that out. You probably should also move the
administrative cgi scripts to a special protected directory as well.
When you are setting up the database, the
second page of the setup process asks you simple questions about the database structure.
The name of the search field, the type of search interface (3 are availabe -
dropdown menu, text field, text area), whether or not it is a required field when adding
new entries, whether or not it is a UNIQUE field (meaning only one entry per unique
element), and whether or not the field should show up on the search results page or on the
dataprofile page.
The best way to explain this is just to set
it up. If you play with the setup script and look at how it creates the search.html
and add.html forms you will have a good idea of what is going on. Note that you can
customize the search and add forms as long as you keep the structural elements together.
Drop down menus can be replaced with radio buttons or similar form fields/etc.