801-803.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 145 行
HTML
145 行
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:Configuring a WAIS Site</TITLE>
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0672313723//-->
<!--TITLE=Linux Unleashed, Third Edition//-->
<!--AUTHOR=Tim Parker//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--CHAPTER=49//-->
<!--PAGES=801-803//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="797-801.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="803-805.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>A number of directories are included in the distribution software, most of which are of obvious intent (<TT>bin</TT> for binaries, <TT>man</TT> for man pages, and so on). The directories used by freeWAIS in its default configuration are as follows:</P>
<TABLE WIDTH="100%"><TR>
<TD WIDTH="5%">
<TD WIDTH="30%">• <TT>bin</TT>
<TD WIDTH="65%">Binaries
<TR>
<TD>
<TD>• <TT>config.c</TT>
<TD>C source code for configuration
<TR>
<TD>
<TD>• <TT>doc</TT>
<TD>Doc files, help files, and FAQs
<TR>
<TD>
<TD>• <TT>include</TT>
<TD>Header files used by the compiler
<TR>
<TD>
<TD>• <TT>lib</TT>
<TD>Library files
<TR>
<TD>
<TD>• <TT>man</TT>
<TD>Man pages
<TR>
<TD>
<TD>• <TT>Src</TT>
<TD>freeWAIS source code
<TR>
<TD>
<TD>• <TT>Wais-Sources</TT>
<TD>Directory of Internet servers
<TR>
<TD>
<TD>• <TT>Wais-Test</TT>
<TD>Sample indexer and service scripts
</TABLE>
<P>Once you have fine-tuned the configuration file information, you can compile the freeWAIS source with the <TT>make</TT> command:</P>
<!-- CODE SNIP //-->
<PRE>
make linux
</PRE>
<!-- END CODE SNIP //-->
<P>By default, the <TT>make</TT> utility compiles two clients called <TT>swais</TT> and <TT>waisq</TT>. If you want to compile an X version of WAIS called <TT>xwais</TT> (useful if you want to allow access from X terminals or consoles), uncomment the line in the <TT>Makefile</TT> that ends with <TT>makex</TT>.</P>
<H3><A NAME="Heading3"></A><FONT COLOR="#000077">Setting Up freeWAIS</FONT></H3>
<P>When you have the compiled freeWAIS components installed and configured properly, you can begin setting up the WAIS index files to documents available on your system. This is usually done by creating an index directory with the default name of <TT>wsindex</TT>. The directory usually resides just under the root of the file system (<TT>/wsindex</TT>) but many administrators like to keep it in a reserved area for the WAIS software (such as <TT>/usr/wais/wsindex</TT>). If the index files are difficult to locate, users may have problems when they try to find them.</P>
<P>The <TT>wais-test</TT> directory created when you installed freeWAIS contains a script called <TT>test.waisindex</TT> that creates four WAIS index files automatically for you. These are used to test the WAIS installation for proper functionality, as well as to show you how you can use the different search and index capabilities of freeWAIS. The following are the four index files:</P>
<TABLE WIDTH="100%"><TR>
<TD WIDTH="5%">
<TD WIDTH="23%" VALIGN="TOP">• <TT>test-BOOL</TT>
<TD WIDTH="72%">Index of three example documents using the Boolean capabilities and synonyms
<TR>
<TD>
<TD>• <TT>test-Comp</TT>
<TD>Index demonstrating compressed source file handling
<TR>
<TD>
<TD VALIGN="TOP">• <TT>test-Docs</TT>
<TD>Index of files in the <TT>doc</TT> directory showing recursive directory search
<TR>
<TD>
<TD>• <TT>test-Multi</TT>
<TD>Index of GIF images and multidocument capabilities
</TABLE>
<P>After graphically based (usually X-based) browsers can handle the <TT>Multi</TT> document formats, although any type of browser should be able to handle the other three index formats.</P>
<P>After you have verified that the indexing system works properly and all the components of freeWAIS are properly installed, you need to build an index file for the documents available on your system. Do this with the <TT>waisindex</TT> command. The <TT>waisindex</TT> command enables you to index files two ways using the <TT>-t</TT> option, followed by one of these keywords:</P>
<TABLE WIDTH="100%"><TR>
<TD WIDTH="5%">
<TD WIDTH="20%" VALIGN="TOP">• <TT>one_line</TT>
<TD WIDTH="75%">Index each line of a document so a match can show the exact line the match occurred in.
<TR>
<TD>
<TD VALIGN="TOP">• <TT>text</TT>
<TD>Index so a match shows the entire document with no indication of the exact line the match occurred in. This is the default option.
</TABLE>
<P>The <TT>waisindex</TT> command takes arguments for the name of the destination index file (<TT>-d</TT> followed by the filename), and the directory or files to be indexed. For example, to index a directory called <TT>/usr/sales/sales_lit</TT> into a destination index file called <TT>sales</TT>, using the <TT>one_line</TT> indexing approach, you would issue the command:</P>
<!-- CODE SNIP //-->
<PRE>
waisindex -d sales -t one_line /usr/sales/sales_lit
</PRE>
<!-- END CODE SNIP //-->
<P>Because there is no path provided for the <TT>sales</TT> index file in this example, it would be stored in the current directory.</P>
<P>After your WAIS server is running (see the section entitled “Starting freeWAIS”), you can test the indexes by using the <TT>waissearch</TT> command. For example, to look for the word “WAIS” in the index files, issue the command:</P>
<!-- CODE SNIP //-->
<PRE>
waissearch -p 210 -d index_file WAIS
</PRE>
<!-- END CODE SNIP //-->
<P>Where <TT>-p</TT> gives the port number (default value is 210), and <TT>-d</TT> is the path to the index file. If the search is successful (and you have something that matches) you will see messages about the number of records returned and the scores of each match. If you see error messages or nothing, check the configuration information and the index files.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="797-801.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="803-805.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?