Installing Search_Engine Script on Win95/98 Servers
October 24,1998
Scott Fleming - hawkwynd@adelphia.net
Based on the scripts Copyright (c) 1996 Steven E. Brenner & Selena Sol
search-engine available for download from http://www.extropia.com
Unpublished work. Permission granted to use and modify this library so long as the copyright above is maintained modifications are documented, and credit is given for any use of the library.
I've written this installation document after realizing the need for documentation on my first installed script from the author above. Let me begin by noting that Steven Brenner's work is appreciated in writing such a fine script that was easily integrated with the Windows 98 environment server.
System Requirements:
Extracting the files
Using Winzip, extract the archive to a folder for your web server, allowing the archive to use foldernames embedded in the archive.
The main portions of files that will require editing are the following:
Open the search-engine.cgi using your favorite text editor.
The first line of the script is the only one you should edit in the search-engine.cgi file.
# !C:\Perl\5.005\bin\MSWin32-x86-object\perl.exe -T
This is the literal path statement for the script to find the perl.exe file. It may not be required, but I always place this line in every script I install, and it has not failed me yet. Do it. Do it first, and do it for every script. Do it.
Save the file, and close it. You are now done with this file. Do not make any changes to this file at this time.
Open search-define.cgi using your favorite text editor.
This file Defines Variables for the search_engine.cgi script, and must be edited to meet your needs. The script will not function properly right out of the box.
Locate the following line:
$root_web_path = "/your root/rootfolder/";
You must use the "/" instead of the "\" for the real path to where your web server is storing it's root directory. This is the literal path to the servers' root directory. This is where the search engine begins searching for HTML, HTM, and all other files. All sub-folders beneath your root are then searched, in order of the tree.
What is the server root???
The server root is the first folder that contains the start of your file for your web site. It contains the index.shtml, htm, html file that calls your first page on the server when visitors come to your site.
Example: My server root directory is C:\httpd\HtDocs, the line would then read:
$root_web_path = "c:/httpd/HtDocs";
Remember, Windows 95/98 servers are not the same as Unix servers, but Perl doesn't care about the OS, and reads all directory trees with the "/" not the "\"
$server_url = "http://hawkwynd.tzo.com";
This line points to the exact URL of your site. Change this line to reflect your own URL.
Unwanted Files to be excluded from the search engine (search-define.cgi)
@unwanted_files = ("Error(.*)html","error(.*)html");
Here we'll set the script to NOT search these files. To add more files, follow the scheme above, and use the literal path to the files location. You can set entire directories to be excluded:
@unwanted_files = ("/HtDocs/","/cgi-bin","/keyword/search.html");
The above line tells the script to skip the /HtDocs folder as well as the /cgi-bin folder, and skip the search.html file in the /keyword folder. Setting the proper unwanted files will speed up your engine, and provide greater security from unwanted information being viewed.
The remainder of the script does not require editing to perform on your server. There are some HTML codes further down that you may wish to modify for cosmetic reasons, but the remainder of the cgi code should be left intact.
CALLING THE SCRIPT FROM YOUR PAGE
To activate the script, use the following syntax: ( or create your own )
<form action="/keyword/search_engine.cgi" method="GET">
<input type="text" size="12" maxlength="50" name="keywords">
<input type="image" name="SUBMIT" src="/icons/search_off.gif">
USING META TAGS TO OPTIMIZE SEARCHES
At this point, you are ready to make the needed changes to your META tags in your pages.
For each page that you wish to be searched, include the following in the <head> </head> section.
Example for my weather page:
<META NAME="DESCRIPTION"
CONTENT="Search any major U.S. city for the latest weather
forecast">
<META NAME="KEYWORDS" CONTENT="weather, search,
forecast, snow, rain, sleet, hail, sun, clouds, wind">
Continue using these tags, which the search script will locate without having to scan the entire page of code for the words being searched.
For more help with script installations on a Windows 95/98 based server, write hawkwynd.
Tips for troubleshooting
If you write me, please include as much information as you can about your system, configuration, web server being used, version of perl, and the URL of the page in question. I'll do what I can to help.