805-806.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 86 行
HTML
86 行
<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=805-806//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="803-805.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="807-809.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading4"></A><FONT COLOR="#000077">Starting freeWAIS</FONT></H3>
<P>As with the FTP services, you can set freeWAIS to start up when the system boots by using the <TT>rc</TT> files from the command line at any time, or you can have the processes started by <TT>inetd</TT> when a service request arrives. If you want to start freeWAIS from the command line, you need to specify a number of options. A sample startup command line looks like this:</P>
<!-- CODE SNIP //-->
<PRE>
waisserver -u username -p 210 -l 10 -d /usr/wais/wais_index
</PRE>
<!-- END CODE SNIP //-->
<P>The <TT>-u</TT> option tells <TT>waisserver</TT> to run as the user <TT>username</TT> (which has to be a valid user in <TT>/etc/passwd</TT>, of course), the <TT>-p</TT> option tells <TT>waisserver</TT> what port to use (the default is 210, as shown in the <TT>/etc/services</TT> file), and the <TT>-d</TT> option shows the default location of WAIS indexes. If you want to invoke logging of sessions to a file, use the <TT>-e</TT> option followed by the name of the logfile.</P>
<P>You should run <TT>waisserver</TT> as another user instead of root to prevent holes in the WAIS system from being exploited by a hacker. If the service is run as a standard user (such as <TT>wais</TT>), only the files that the user would have access to would be in jeopardy.</P>
<P>If the port for <TT>waisserver</TT> is set to 210, the service corresponds to the Internet standards for access. If you set the value to another port, you can configure the system for local area access only. If the port number is less than 1023, the WAIS service must be started and managed by root, but any port over 1023 can be handled by a normal user. If you intend to use port 210, you don’t have to specify the number in the command line, although the <TT>-p</TT> option still must be used.</P>
<P>If you want to let <TT>inetd</TT> handle the <TT>waisserver</TT> startup, you need to ensure the file <TT>/etc/services</TT> has an entry for WAIS. The line in the <TT>/etc/services</TT> file looks like this, where <TT>210</TT> is the port number WAIS uses, and <TT>tcp</TT> is the protocol:</P>
<!-- CODE SNIP //-->
<PRE>
z3955 210/tcp #WAIS
</PRE>
<!-- END CODE SNIP //-->
<P>After modifying or verifying the entry in <TT>/etc/services</TT>, you need to add a WAIS entry to the <TT>inetd.conf</TT> file to start up <TT>waisserver</TT> whenever a request is received on port 210 (or whatever other port you are using). The entry looks like this, where the options are the same as for the command line startup mentioned above:</P>
<!-- CODE SNIP //-->
<PRE>
z3955 stream tcp nowait root/usr/local/bin/waisserver/waisserver.d
-u username -d /usr/wais/wais_index
</PRE>
<!-- END CODE SNIP //-->
<P>The daemon <TT>waisserver.d</TT> is used when starting up in <TT>inetd</TT> mode, instead of <TT>waisserver</TT>. Again you can use the <TT>-e</TT> option to log activity to a file.</P>
<H3><A NAME="Heading5"></A><FONT COLOR="#000077">Building Your WAIS Indexes</FONT></H3>
<P>After you have the freeWAIS server ready to run and everything seems to be working, it’s time to provide some content for your WAIS system. Usually, documents are the primary source of information for WAIS, although you can index any type of file. The key step to providing WAIS service is to build the WAIS index using the <TT>waisindex</TT> command. The <TT>waisindex</TT> command can be a bit obtuse at times, but a little practice and some trial-and-error fiddling will help you master its somewhat awkward behavior.</P>
<P>The <TT>waisindex</TT> program works by examining all the data in the files of which you want to create an index. From its examination, <TT>waisindex</TT> usually generates seven different index files (depending on the content and your commands). Each file holds a list of unique words in the documents. The different index files are then combined into one large database, often called the “source” (or “WAIS source”). Whenever a client WAIS package submits a search, the search strings are compared to the source, and the results displayed with accuracy analysis (the match score).</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>Tip: </B><BR>The use of <TT>waisindex</TT> enables a client search to proceed much more quickly because the keywords in the data files have already been extracted. However, the mass of data in the index files can be sizable, so allow plenty of disk space for a WAIS server to work with. (For a typical WAIS site, assume at least double the amount of room needed for the source files.)<HR></FONT>
</BLOCKQUOTE>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="803-805.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="807-809.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?