803-805.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 122 行

HTML
122
字号
<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=803-805//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="801-803.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="805-806.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P>A final step you can take if you want your freeWAIS system to be accessible by Internet users is to issue this command, where <I>Filenames</I> is the name of the index:</P>

<!-- CODE SNIP //-->

<PRE>

waisindex -export -register<I>Filenames</I>

</PRE>

<!-- END CODE SNIP //-->

<P>This is registered with the Directory of Servers at <TT>cnidr.org</TT> and <TT>quake.think.com</TT>. These addresses are reached automatically with the <TT>-register</TT> option. Only do this step if you want all Internet users to access your WAIS service. (We will look at the <TT>waisindex</TT> command in much more detail shortly.)</P>

<P>If you want to enable clients to connect to your freeWAIS system with a WWW browser (such as Mosaic or Netscape), you must issue this command:</P>

<!-- CODE SNIP //-->

<PRE>

waisindex -d WWW -T HTML -contents -export /usr/resources/*html

</PRE>

<!-- END CODE SNIP //-->

<P>Replace the <TT>/usr/resources</TT> path with the path to your HTML files. This line allows WAIS clients to perform keyword searches on HTML documents, as well.</P>

<P>If you want, you can set WAIS to only allow certain domains to connect to it. This is done in the <TT>ir.h</TT> file, which has a line like this:</P>

<!-- CODE SNIP //-->

<PRE>

#define SERVSECURITYFILE  &#147;SERV_SEC&#148;

</PRE>

<!-- END CODE SNIP //-->

<P>You have to place a copy of an existing <TT>SERV_SEC</TT> file or one you create yourself in the same directory as the WAIS index files. If there is no <TT>SERV_SEC</TT> file accessible to WAIS, all domains are allowed access. (You can change the name of the file, of course, as long as the entry in <TT>ir.h</TT> matches the filename with quotation marks around it.)</P>

<P>Each ASCII entry in the <TT>SERV_SEC</TT> file follows a strict format for defining the domains that are granted access to WAIS. The format of each line is:</P>

<!-- CODE SNIP //-->

<PRE>

<I>domain</I> [<I>IP address</I>]

</PRE>

<!-- END CODE SNIP //-->

<P>Each line has the domain name of the host that you want to grant access to with its IP address as an optional add-on to the line. If the domain name and IP address do not match, it doesn&#146;t matter because WAIS allows access to a match of either name or address. A sample <TT>SERV_SEC</TT> file looks like this:</P>

<!-- CODE SNIP //-->

<PRE>

chatton.com

roy.sailing.org

bighost.bignet.com

</PRE>

<!-- END CODE SNIP //-->

<P>Each of these three domain names can access WAIS, while any connection from a host without these domain names is refused.

</P>

<P>The <TT>SERV_SEC</TT> file should be owned and accessible only by the user that the freeWAIS system is running as (it should not be run as root to avoid security problems), and the file should be modifiable only by root.</P>

<P>Similar to the <TT>SERVSECURITYFILE</TT> variable is <TT>DATASECURITYFILE</TT>, which controls access to the databases. There is a line in the <TT>ir.h</TT> file which looks like this:</P>

<!-- CODE SNIP //-->

<PRE>

#define DATASECURITYFILE  &#147;DATA_SEC&#148;

</PRE>

<!-- END CODE SNIP //-->

<P>Where <TT>DATA_SEC</TT> is a file listing each database file and the domains that have access to it. The file should reside in the same directory as the index files. The format of the <TT>DATA_SEC</TT> file is as follows:</P>

<!-- CODE SNIP //-->

<PRE>

<I>database  domain</I> [<I>IP address</I>]

</PRE>

<!-- END CODE SNIP //-->

<P>Where <TT>database</TT> is the name of the database the permissions refer to, and <TT>domain</TT> and the optional <TT>IP address</TT> are the same as the <TT>SERV_SEC</TT> file. A sample <TT>DATA_SEC</TT> file looks like this:</P>

<!-- CODE SNIP //-->

<PRE>

primary  chatton.com

primary  bignet.org

primary  roy.sailing.org

sailing  roy.sailing.org

</PRE>

<!-- END CODE SNIP //-->

<P>In this example, three domains are granted access to a database called <TT>primary</TT> (note that <TT>primary</TT> is just a filename and has no special meaning), while one domain has specific access to the database called <TT>sailing</TT> as well as <TT>primary</TT>. If you want to allow all hosts with access to the system (controlled by <TT>SERV_SEC</TT>) to access a particular database, you can use asterisks in the domain name and IP address fields. For example, these entries allow anyone with access to WAIS to use the <TT>primary</TT> database, with one domain only allowed access to the <TT>sailing</TT> database:</P>

<!-- CODE SNIP //-->

<PRE>

primary  *  *

sailing  roy.sailing.org

</PRE>

<!-- END CODE SNIP //-->

<P>In both the <TT>SERV_SEC</TT> and <TT>DATA_SEC</TT> files, you have to be careful with the IP addresses to avoid inadvertently granting access to hosts you really don&#146;t want on your system. For example, if you specify the IP address 155.12 in your file, then any IP addresses from 155.12 through 155.120, 151.121, and so on, are also granted access because they match the IP components. Specify IP addresses explicitly to avoid this problem.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="801-803.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="805-806.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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