support/faq

Installing Matt's Simple Search Script

Here's a nice script to implement a personal site search engine. Simple Search may not be the most efficient search tool on the internet according to its author, but it can sift through hundreds of documents and get the job done.

Installation Procedure

  1. Locate and download the following files from Matt's Script Archive:

    search.pl - The Perl script performs search and reports findings.

    search.html - The HTML file containing the form users fill-out.

  2. Change the first line of the Perl script to reflect the official path to Perl on our server:
    #!/usr/bin/perl 
  3. There are a few more things that need to be changed in the Perl script:

    # Define Variables

    $basedir = The system path to the directory with searchable files.

    $baseurl = The URL to the base directory above.

    @files = Array which includes the files you wish to search.

    $title = The title of the generated search results page

    $title_url = The URL to the directory containing search.html

    $search_url = The URL to the search.html form.

    The first variable callsfor a system path which is not the same as a URL. If your domain name was yourdomain.com the system path would be /home/yourdo where "yourdo" is the account userid.

    As such, the Set Variables section of the Links script would follow this format:

    # Define Variables

    $basedir = '/home/<userid>/files/';

    $baseurl = 'http://www.yourdomain.com/files/';

    @files = ('*.shtml','demos/links/*.html','demos/guest/*.html');

    $title = "Matt's Simple Search";

    $title_url = 'http://www.yourdomain.com/';

    $search_url = 'http://www.yourdomain.com/search.html';

    The first and second settings above suggest that the searchable files reside in a subdirectory called files. Be sure to substitute your domain name and userid in the example above. Although Matt's code is accurate, we recommend checking all scripts' code before installing any Perl script.

  4. Upload the "search.pl" script to your cgi-local directory in ASCII transfer mode.chmod 755 the Perl script to set the proper permissions on the file.
  5. Modify the form ACTION attribute within "search.html" to reference the search script within cgi-local as shown below and upload to your root ("home") directory.
    <FORM METHOD="POST" ACTION="/cgi-bin/search.pl">     

You can test the script by referencing the links.html file via the web.

Special Notes

  • You can modify the search.html file to meet your own design standards.
  • Some possible causes of a SERVER ERROR:

    - Define Variables section within Perl script inaccurate
    - Perl script was not uploaded in ASCII transfer mode

  • You can modify the @files array variable to specify the file types and additional path information of the searchable files. The directory paths and filenames should be in reference to $basedir. To search only HTML and SHTML files in $basedir set the array variable to:
    @files = ('*.shtml','*.html');     
  • Using descriptive documenttitles will help your visitors locate files of interestmore efficiently.

 

Register Your Domain Today!

Check Availability

 

     More Info

 

Partner With Us

 

Request More Information

 

Sign up for our newsletter