| |
SWISH-E - Web Site Search Utility
A convenient method to allow clients to retrieve information from a web site is by building an
index of the web pages and providing search capability. This may seem like a daunting task, but
with a few tools this task becomes very easy.
Normally web indexing and searching requires a complex, hard to use and install WAIS-based
solution, however a small yet powerful program
SWISH-E, (which is based on SWISH written by
Kevin Hughes), can be used to fulfill your web indexing and searching needs.
Installation
To install SWISH-E on your Virtual Private Server, connect via
Telnet or SSH and run this command:
% vinstall swish-e
NOTE: Swish-e requires the
Perl LWP module to run. |
Usage
To use SWISH-E, do the following.
Create a SWISH-E configuration file for your Virtual Private Server. You may copy or edit
the following sample configuration files to meet your needs, according to your server O/S:
FreeBSD &
Solaris [SWISH-E 2.0.5]
A sample configuration file can be found on your server in the following location:
~/usr/local/swish-e-2.0.5/conf/user.config
BSD/OS Upgrade!
[SWISH-E 1.3]
A sample configuration file is installed on your server:
~/usr/local/swish-e/swish.conf
Huh?
If you don't know the Virtual Private Server O/S, try the following:
Make sure you change all occurrences of LOGIN_NAME in the files to match the login
name of your server. Other modifications may also be necessary. You should become familiar
with the FileRules section of the configuration file. By default, SWISH-E will not index
files in directories containing a .htaccess file. If you have a directory that contains
a .htaccess file, and would like it indexed, then comment out that FileRules line
by placing a # as the first character in the line.
NOTE: Create a separate configuration file for each search
on your Virtual Private Server. For example, if you have several users on your server that
require separate searches for their own directories, create a separate configuration file
for each user. Then use the configuration files to create separate index files for each
search. |
To create a Web site index, run the swish-e program like this, depending on your
Virtual Server O/S (and substituting the name of your SWISH-E configuration file you created in
the previous step for CONFIG_FILE):
When you run the SWISH-E executable, a SWISH-E index file will be generated. The name of the
SWISH-E index file is that which you specified as the value for the IndexFile variable
in the SWISH-E configuration file.
The Search Form
To install the search on your web site you will need to download the
Search Form and store it
somewhere in your usr/local/etc/httpd/htdocs directory structure. Feel free to customize
the form, add graphics, etc., but be sure that the variable name for each input field is
not altered.
The form can be customized for your Virtual Private Server by simply changing the occurrence of
SWISH_INDEX_FILE to the name of the swish-e index which you specified as the value for the
IndexFile variable in the SWISH-E configuration file. You may hide the maxresults
field by simply using a type=hidden argument with the input tag.
The Search CGI
The CGI for SWISH-E needs to be modified depending on your
Virtual Private Server O/S
FreeBSD &
Solaris
The CGI script is installed into your www/cgi-bin/ directory with the name
search.pl.sample. You will need to change the filename to search.pl and make it
executable. From the SSH or Telnet prompt, run
the following commands:
% mv search.pl.sample search.pl
% chmod 655 search.pl
You can customize the appearance of the search CGI, if you wish. Two subroutines in the
~/www/cgi-bin/search.pl file, print_header and print_footer are used to
print out header and footer information. You can find these by searching for the string
MODIFY ME in the script. You can then insert whatever HTML you want between the line
print <<_HTML_; and _HTML_.
BSD/OS Upgrade!
Two subroutines in the ~/www/cgi-bin/library/searchindex/util.pl file,
print_header_info and print_footer_info are used to print out header and footer
information.
Feel free to modify these functions such that the CGI outputs pages that are in synch with
the motifs of the rest of your site.
More Information
For more information and documentation see:
|