⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch49.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 4 页
字号:


<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->










<font face="Arial,Helvetica" size="-1" color="#006666">

<b>Linux</b></font><p>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">











 

























<UL>



	<LI><A HREF="#Heading1">- 49 -</A>



	<UL>



		<LI><A HREF="#Heading2">Configuring a WAIS Site</A>



		<LI>



		<UL>



			<LI><A HREF="#Heading4">FIGURE 49.1.</A>



			<LI><A HREF="#Heading5">FIGURE 49.2.</A>



			<LI><A HREF="#Heading6">FIGURE 49.3.</A>



		</UL>



		<LI><A HREF="#Heading7">Compiling and Installing freeWAIS</A>



		<UL>



			<LI><A HREF="#Heading8">Setting Up freeWAIS</A>



			<LI><A HREF="#Heading9">Starting freeWAIS</A>



			<LI><A HREF="#Heading10">Building Your WAIS Indexes</A>



			<LI><A HREF="#Heading11">NOTE</A>



			<UL>



				<LI><A HREF="#Heading12">WAIS Index Files</A>



				<LI><A HREF="#Heading13">The waisindex Command</A>



			</UL>



			<LI><A HREF="#Heading14">NOTE</A>



			<UL>



				<LI><A HREF="#Heading15">Getting Fancy</A>



			</UL>



			<LI><A HREF="#Heading16">Summary</A>



		</UL>



	</UL>



</UL>







<P>



<HR SIZE="4">







<H2 ALIGN="CENTER"><A NAME="Heading1<FONT COLOR="#000077">- 49 -</FONT></H2>



<H2 ALIGN="CENTER"><A NAME="Heading2<FONT COLOR="#000077">Configuring a WAIS



Site</FONT></H2>



<H2 ALIGN="CENTER"><FONT COLOR="#000077"></FONT></H2>



<P><I>by Tim Parker</I></P>



<P>IN THIS CHAPTER</P>







<UL>



	<LI>Compiling and Installing freeWAIS



	<P>



	<LI>Setting Up freeWAIS



	<P>



	<LI>Starting freeWAIS



	<P>



	<LI>Building Your WAIS Indexes



</UL>







<P>WAIS (Wide Area Information Service) is a menu-based tool that enables users to



search for keywords in a database of documents available on your system and show



the results. WAIS was developed by Thinking Machines but spun off to a separate company



called WAIS Inc., when it became immensely popular. A free version of WAIS was made



available to the Clearinghouse for Networking Information Discovery and Retrieval



(CNIDR) as freeWAIS, which is the version most often found on Linux systems.<BR>



<BR>



WAIS lets a user enter some keywords or phrases, and then searches a database for



those terms. A typical WAIS search screen is shown in Figure 49.1. (This screen is



from the primary WAIS server at <TT>http://www.wais.com</TT>. This server is a good



place to look for examples of how WAIS can be used.) In this example, we searched



for the keywords <TT>hubble</TT> and <TT>magnitude</TT> (WAIS usually ignores case).



After searching all the database indexes it knows about, WAIS shows its results,



as shown in Figure 49.2.



<H6></H6>



<P><A NAME="Heading4<A HREF="../art/49/50lnx01.jpg"><FONT COLOR="#000077">FIGURE



49.1.</FONT></A><FONT COLOR="#000077"><I> </I></FONT><I>You can enter complex or



simple search criteria on a WAIS search line. </I><BR>



<BR>



The display generated by WAIS, often displayed in a WWW browser or a WAIS browser



as in these figures, lists each match along with its score from 0 to 1000, indicating



the manner in which the keywords match the index (the higher numbers are better matches).



Users can then refine the list, expand it, or examine documents listed. In Figure



49.3, one of the documents listed in the search results is displayed in the WWW browser



window. WAIS can handle many file formats, including text and documents, audio, JPEG



and GIF files, and binaries.</P>



<P>The version of WAIS used commonly with Linux is called freeWAIS. This chapter



looks at how you can set up a freeWAIS server on your Linux machine. WAIS is a useful



service to provide if you deal with a considerable amount of information that you



want to make generally available. This could be product information, details about



a hobby, or practically any other type of data. All you have to want to do is make



it available to others, either on your local area network or to the Internet as a



whole.



<H6></H6>



<P><A NAME="Heading5<A HREF="../art/49/50lnx02.jpg"><FONT COLOR="#000077">FIGURE



49.2.</FONT></A><FONT COLOR="#000077"> </FONT><I>WAIS displays the search results



with a score.</I>



<H6></H6>



<P><A NAME="Heading6<A HREF="../art/49/50lnx03.jpg"><FONT COLOR="#000077">FIGURE



49.3.</FONT></A><FONT COLOR="#000077"> </FONT><I>Selecting any entry on the WAIS



search results lets you see the file.</I></P>



<P>The freeWAIS package has three parts to it: an indexer, a WAIS server, and a client.



The indexer handles database information and generates an index that contains keywords



and a table indicating the words' occurrences. The server component does the matching



between a user's requests and the indexed files. The client is the user's vehicle



to access WAIS, and is usually a WAIS or WWW browser. WWW browsers usually have an



advantage over WAIS browsers in that the latter cannot display HTML documents.</P>



<P>A follow-up backwards-compatible WAIS system is currently available in a beta



version called ZDIST. ZDIST's behavior will be much like freeWAIS, with any changes



noted in the documentation. ZDIST adds some new features and is a little smaller



and faster than freeWAIS. Because of the unstable beta nature of ZDIST, we'll concentrate



on freeWAIS here.



<H3 ALIGN="CENTER"><A NAME="Heading7<FONT COLOR="#000077">Compiling and Installing



freeWAIS</FONT></H3>



<P>The freeWAIS software is often included in a complete Linux distribution CD-ROM



but is also readily available from many FTP and BBS sites. Alternatively, it can



be obtained by anonymous FTP from the <TT>CNIDR</TT> site as <TT>ftp.cnidr.org</TT>.



The freeWAIS system resides in the directory <TT>ftp://ftp.cnidr.org/pub/NIDR.tools/freewais/</TT>.



The <TT>CNIDR</TT> site has many binaries available for different machines, as well



as generic source code that can be tailored to many different systems.</P>



<P>One of the files in the distribution software, which should be placed in the destination



directory, is the <TT>Makefile</TT> used to create the program. If you are compiling



the freeWAIS source yourself, examine the <TT>Makefile</TT> to ensure the variables



are set correctly. Most are fine by default, pointing to standard Linux utilities.



The following lists some of the exceptions that you may have to tweak:<BR>







<TABLE BORDER="0" WIDTH="100%">



	<TR>



		<TD WIDTH="10%">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="14%"><TT>CC</TT></TD>



		<TD WIDTH="76%">The name of the C compiler you use (usually <TT>cc</TT> or <TT>gcc</TT>).</TD>



	</TR>



	<TR>



		<TD WIDTH="10%">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="14%"><TT>CURSELIB</TT></TD>



		<TD WIDTH="76%">Set to the current version of the <TT>curses</TT> library on your system.</TD>



	</TR>



	<TR>



		<TD WIDTH="10%">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="14%"><TT>TOP</TT></TD>



		<TD WIDTH="76%">The full path to the freeWAIS source directory.</TD>



	</TR>



</TABLE>



<BR>



The <TT>CFLAGS</TT> options let you specify compiler flags when the freeWAIS source



is compiled. Many options are supported, all explained in the documentation files



that accompany the source. Most of the flag settings can be left as their default



values in Linux systems. A few of the specific flags you may want to alter are worth



mentioning, though. The most useful are the indexer flags, two of which are potentially



useful:<BR>







<TABLE BORDER="0" WIDTH="100%">



	<TR>



		<TD WIDTH="10%" VALIGN="TOP">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="14%" VALIGN="TOP"><TT>-DBIO</TT></TD>



		<TD WIDTH="76%" VALIGN="TOP">Used to allow indexing on biological symbols and terms. Use only if your site deals



			with biological documents.</TD>



	</TR>



	<TR>



		<TD WIDTH="10%" VALIGN="TOP">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="14%" VALIGN="TOP"><TT>-DBOOLEANS</TT></TD>



		<TD WIDTH="76%" VALIGN="TOP">Enables you to use Booleans as <TT>AND</TT> and <TT>NOT</TT>. This flag can be handy



			for extending the power of searches.</TD>



	</TR>



</TABLE>



<BR>



The <TT>-DBOOLEANS</TT> flag handles logical searches. For example, if you are looking



for the keywords &quot;green leaf,&quot; WAIS by default searches for the words green



and leaf separately and judges matches on the two words independently. With the <TT>-DBOOLEANS</TT>



flag set, the two words can be <TT>AND</TT>ed together so a match has to be with



the two-word term &quot;green leaf.&quot;</P>



<P>A couple of other flags that may be useful for freeWAIS sites deal with the behavior



of the system as a whole:<BR>







<TABLE BORDER="0" WIDTH="100%">



	<TR>



		<TD WIDTH="9%" VALIGN="TOP">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="15%" VALIGN="TOP"><TT>-DBIGINDEX</TT></TD>



		<TD WIDTH="76%" VALIGN="TOP">Should be set when there are many (thousands) of documents to index.</TD>



	</TR>



	<TR>



		<TD WIDTH="9%" VALIGN="TOP">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="15%" VALIGN="TOP"><TT>-DLITERAL</TT></TD>



		<TD WIDTH="76%" VALIGN="TOP">Allows a literal search for a string, as opposed to using partial hits <BR>



			on the string's component words.</TD>



	</TR>



	<TR>



		<TD WIDTH="9%" VALIGN="TOP">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="15%" VALIGN="TOP"><TT>-DPARTIALWORD</TT></TD>



		<TD WIDTH="76%" VALIGN="TOP">Allows searches with asterisks as wildcards (such as <TT>auto*</TT>).</TD>



	</TR>



	<TR>



		<TD WIDTH="9%" VALIGN="TOP">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="15%" VALIGN="TOP"><TT>-DRELEVANCE_FEEDBACK</TT></TD>



		<TD WIDTH="76%" VALIGN="TOP">Set to <TT>ON</TT>, enables clients to use previous search results as search <BR>



			criteria for a new search. This is a useful option.</TD>



	</TR>



</TABLE>



<BR>



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 listed



here:<BR>







<TABLE BORDER="0" WIDTH="100%">



	<TR>



		<TD WIDTH="9%" VALIGN="TOP">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="15%" VALIGN="TOP"><TT>bin</TT></TD>



		<TD WIDTH="76%" VALIGN="TOP">Binaries</TD>



	</TR>



	<TR>



		<TD WIDTH="9%" VALIGN="TOP">



			<UL>



				<LI>&#160;



			</UL>



		</TD>



		<TD WIDTH="15%" VALIGN="TOP"><TT>config.c</TT></TD>



		<TD WIDTH="76%" VALIGN="TOP">C source code for configuration</TD>



	</TR>



	<TR>



		<TD WIDTH="9%" VALIGN="TOP">



			<UL>



				<LI>&#160;



			</UL>



		</TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -