LSearch
LSearch is an easy-to-use, robust search engine package that you may install on your Web site. It works best for small (under 200 pages) Web sites. The two main components of the LSearch package are: lsedit.pl lsearch.html Features of LSearch include:
Bugs of LSearch include:
Before installing LSearch, you will need to have a Web site at U.Va. Click here for more information about setting up Web sites at U.Va. In order to install LSearch, you will need to perform two basic steps:
Build an index with the lsedit tool Open your Web browser (such as Netscape or Internet Explorer) and go to your lsedit.pl file. For example, if your user id is mst3k, your lsedit.pl file is located at:
Log in to the editor with the password you supplied when you installed LSearch in Step 2 above. You will then see a small example data file with one record and three keywords, similar to the following:
Keywords are separated by a red asterisk ( * ). For this reason, you may not use an asterisk in any of your index records. Editing existing records If you would like to edit the keywords for your home.html file, click on the #0 link. This will take you to a screen where you may edit individual records. Enter whatever Description and Keyword values you like, and then click "Modify Record".
Adding new records New records are always inserted before an existing record. To add a new record, enter a 0 in the "Insert new record before number" field, as below, and then click the "Insert new" button.
You will then get a new record, to which you should add the name of another file in your Web site, a description, and keyword values. Keyword values should be all lowercase, and they should be separated by spaces. An example is as follows:
When you have finished entering the new information, click on the "Modify record" button. Note When search results are returned, they are returned in the order in which they occur in the data file. For this reason, you should put the more important records towards the beginning of the file. There is no way to reorder the records without using a UNIX text editor, which is a complex operation that is not covered in this document. Create a form and put it on your Web site A file called lsearch.html has already been installed in your Web site, and you may use this both as a search form and as a results template. If you would like to edit the lsearch.html file to reflect the style of your Web site, you may do so, but be careful not to remove the following string:
or your template will no longer work. {search} is the placeholder for pages that match the keywords that have been entered. Note If you would like to incorporate the search form on a different page in your Web site (for example, if you want a search form to appear at the bottom of a page in your Web site or as part of a navigation banner), you should copy the html source of the form, which will look similar to the following:
and paste it in your document. Whenever a visitor at your site enters keywords that return no search results, those keywords are added to a file called "notfound.html". You should check this file periodically. This will help you determine if there are additional keywords you should consider adding to your index file. If you performed the default installation of LSearch, and if your user id is mst3k, you may view your notfound.html file at:
When you install LSearch, you supply a password to use in order to access your index files. As LSearch is installed, that password is embedded in the lsedit.pl script. Anyone who reads that script will see this password. This is a very modest level of security. It will prevent most people from editing your index data file, but a determined hacker may find a way to break into your index data file. You should keep a backup of your index data file (the file is called "lspages.dat") in some location outside of your Web site. If you are using lsedit.pl from a public lab, make sure no one is watching when you enter your password, and always follow the instructions about restarting or refreshing the computer when you leave the lab. Since this password is in clear text in the lsedit.pl script, if your Web site security is compromised, this password will also be compromised. For this reason DO NOT use your UNIX or e-mail password as your LSearch password. If you have further questions about security, please write to web-consult@virginia.edu. Installing in an alternate directory If you use the default installation of LSearch, as outlined earlier in this document, LSearch will be installed in your public_html directory. Technically speaking, LSearch can be installed in any directory, although in general you must install it in your public_html directory, or a subdirectory of your public_html directory. Contact your system administrator (or write to web-consult@virginia.edu) for detailed information. To install LSearch in an alternate directory, use the following command at the UNIX prompt:
where <password> is some word (do not use your e-mail or UNIX account password) and <directory-name> is the full path to the directory in which you would like to install LSearch. Here is an explicit example:
If you do not use the complete file path, the installation will not work correctly. Installing LSearch in a departmental directory (without a public_html directory) Many departmental Web sites do not have a public_html directory. If this is your situation, you will need to type the following command at the UNIX prompt:
where <password> is some word (do not use your e-mail or UNIX account password), and <directory-name> is the full path to the directory in which you would like to install LSearch. Do not forget the -s at the end! Here is an explicit example:
If you are a programmer, you may find the following details interesting, but you don't need to understand them to use LSearch. The addition of the "-s" changes the configuration of the Perl CGI scripts and installs the program lswriter, which is suid. The suid feature is necessary for a program to write to a file in a Web directory which is not a particular user's public_html directory. The suid feature cannot be added to Perl scripts, and therefore the lswriter program is necessary. If you try to edit your index of pages using lsedit.pl, and no update occurs, check the permissions on the lswriter program. To work properly, it must have the "sticky bit" (s instead of x) set for the file's owner. If you look at a long listing (Unix command: ls -l ) of the files, you should see something similar to the following (for owner "mst3k" and group "mygroup"):
If it does not, use the following command to make the change:
The following files are created when you install LSearch:
Web
Development Support | General
Info | Getting Started
| Design & Promotion
If you need further assistance with Web applications or questions, send e-mail to web-consult@virginia.edu or call the ITC Help Desk at 924-3731. |
||||||||||||||||||||||||||||||||||||