KSearch - An Excellent Free Website Indexer and Search
Engine Script
Introduction
Several companies offer free offsite search for your website. The best of these and the one I used for a couple years was Atomz (www.atomz.com). The disadvantage of using one of these services is that they add either advertisements or links off your site. Most do not offer custom templates so that your search results page does not match your site navigation (with Atomz being the exception). Atomz has the disadvantage of only offering its free services to sites with fewer than 500 pages. When this site went over 500 pages, I began to search for a free search script that didn't require ads. After testing many different free website search engines, I have determined that KSearch is the best free script. However, its relevance was not as good as Atomz or FM SiteSearch Pro (an inexpensive site search script).
Installation
This is a simplified, "quick and dirty" instruction set to get the program up and running.
- Download the program at http://www.kscripts.com/.
- Extract the downloaded program using Win Zip or other zip extraction program.
- Open the "ksearch" folder. Open the "ksearch.cgi" file with a text editor (like Notepad, BBedit, etc.). Edit the first line (Path to Perl) if necessary. For most hosts, no editing will be necessary (default is "#!/usr/bin/perl").
- Open the "configuration" folder within the "ksearch" folder.
Open the "configuration.pl" file with a text editor. You must edit
four settings within this file. If your hosting service uses CPANEL,
these are the settings you should use:
- $INDEXER_START = '/home/yourusername/public_html/';
- $BASE_URL ='http://www.yourwebsite.com/';
- $SEARCH_URL = "http://yourwebsite.com/cgi-bin/ksearch/ksearch.cgi";
- $KSEARCH_DIR = '/home/yourusername/public_html/cgi-bin/ksearch/'; # re-index
- Other settings in the "configuration.pl" file may be edited, depending upon how you want the searches to be done. For most users, the default settings are fine.
- If there are directories that you do not want searched, you must edit the "ignore_files.txt" file within the "configuration" folder (e.g., /home/yourusername/public_html/cgi-bin).
- Upload the entire "ksearch" folder using an FTP client into the cgi-bin directory where your html files go. Change the permissions of the "ksearch.cgi", "indexer.pl", and "indexer.cgi" files within the "ksearch" folder to 755.
- There are two ways to index your site. One way is to
run the "indexer.cgi" file from within your browser (in
order to do this, you must enter a password where indicated in the "configuration.pl"
file). This script may or may not work, depending upon how large your
site is and how long a script is allowed to run on your host before
timing out. The documentation indicates that
the script will probably timeout on large websites and, thus, fail to
index your site. I recommend using indexer.pl from Telnet. Here are
the instructions for doing this if your host uses CPANEL:
- Log into your control panel. Click the link that is labeled "SSH Session" (it may be labeled "SSH/Telnet shell access" under the "Access Menu", depending upon which version of CPANEL is running). The browser will start another process that will appear in a separate window. Alternatively you can use a standalone program, such as PuTTY.
- When the prompt comes up, hit "Enter". Another prompt will prompt for your username (the same one you use for CPANEL). Type in your username and press "Enter". If you are prompted with an error message, click "yes" to continue.
- Enter your password and "Enter".
- Type "/home/yourusername/public_html/cgi-bin/ksearch/indexer.pl" and enter. The display will show the files as they are being processed. When the program has completed, it will indicate how many files were processed and the processing time. For this site, it took ~5 minutes for 1,477 files (16,173 KB) with 1,500,894 total search terms.
- Exit your Telnet session.
- You can do a simple search using the following code:
<form action="http://yourwebsite.com/cgi-bin/ksearch/ksearch.cgi" method="get" name="search">
<input type="text" name="terms"><input type="submit" value="Search">
</form> - A more advanced search form is available with the documentation ("search_form.html") or see below.
Templates
Templates are not necessary, but provide a way to match the look and navigation of your site. Create the template using your favorite HTML editor or use one that you have already created. The default Ksearch template ("search.html") is located within the "templates" folder within the "ksearch" folder. Make sure that you use absolute links (e.g., "/images/your.jpg") so that all your images, scripts, and stylesheets are referenced correctly. Copy the code from the "search.html" page into your template and upload the revised "search.html" file into your cgi-bin/ksearch/templates folder.
Conclusion
There are many more options and much more documentation on the KSearch website. However, these brief instructions will get you going without having to wade through their documentation. Check KSearch in action on this site:
Daily Deals from Buy.com
We are a leading retailer focused on providing a positive shopping experience & competitive prices and free shipping for over 12 million products.
- 11/06/2012 02:00 AM
Free Shipping on a Samsung P2770FH 27" Widescreen Full HD LCD Monitor - 70,000:1 (DC), 1ms, 1920 x 1080, HDMI (Black) - Refurbished for $215 at Buy.com, a $244 Savings! Valid through 11/11/2012
PRODUCT: Buy.com Price: $215, List Price: $459 SAVE $244, Valid 11/11/2012
image/jpg (1 Bytes) - 11/06/2012 02:00 AM
Free Shipping on a Dragon NaturallySpeaking Premium 12.0, English for $99.99 at Buy.com, a $100 Savings! Valid through 11/11/2012
PRODUCT: Buy.com Price: $99.99, List Price: $199.99 SAVE $100, Valid 11/11/2012
image/jpg (1 Bytes) - 11/06/2012 02:00 AM
Free Shipping on a Brother DCP-7065DN Laser Multifunction Monochrome Printer w/ 2400 x 600dpi Resolution, Scanner, Copier, 26ppm Print for $129.99 at Buy.com, a $200 Savings! Valid through 11/11/2012
PRODUCT: Buy.com Price: $129.99, List Price: $329.99 SAVE $200, Valid 11/11/2012
image/jpg (1 Bytes) - 11/06/2012 02:00 AM
Free Shipping on a Nikon D5100 Digital SLR Camera w/ 18-55mm VR Lens, 8GB Memory Deluxe Bundle for $619.99 at Buy.com, a $275.01 Savings! Valid through 11/11/2012
PRODUCT: Buy.com Price: $619.99, List Price: $895 SAVE $275.01, Valid 11/11/2012
image/jpg (1 Bytes) - 11/06/2012 02:00 AM
Free Shipping on an Acer 11.6" AMD C-60 1 GHz Netbook | AO722-0825 - Refurbished for $269.99 at Buy.com, a $129.01 Savings! Valid through 11/11/2012
PRODUCT: Buy.com Price: $269.99, List Price: $399 SAVE $129.01, Valid 11/11/2012
image/jpg (1 Bytes)
http://www.godandscience.org/general/ksearch.html
Last Modified December 10, 2007