?? 722-724.html
字號:
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:Configuring Linux for News</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=41//-->
<!--PAGES=722-724//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="719-722.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="724-726.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading3"></A><FONT COLOR="#000077">NNTP</FONT></H3>
<P>NNTP can operate in two modes: active and passive. The active mode, as mentioned earlier, is often called pushing and is much the same as CNews’ <TT>ihave/sendme</TT> protocol in which the sender (client) offers a particular article and waits for the receiver (server) to accept or refuse the article. Push mode has a disadvantage for the server in that it has a high overhead, as each article must be checked in turn.</P>
<P>The passive mode, or pulling, has the receiving machine requesting a list of all articles in a particular newsgroup that have arrived since a specified date. This is done through a <TT>newnews</TT> command. When the receiving machine has all the articles, it then discards any that are duplicated or not wanted using the <TT>article</TT> command. This is much easier for the sending machine because it simply sends a mass of articles, but there is a security issue in that the server has to make sure it sends information that is allowed to pass to the receiver.</P>
<P>NNTP is implemented on a Linux system with the NNTP daemon developed by Stan Barber and Phil Lapsley, known almost universally as the “reference implementation daemon” or <TT>nntpd</TT>. Usually, you only have the source code for the NNTP daemon supplied with a Linux distribution because there are several site-specific details that must be linked into the binary.</P>
<P>The <TT>nntpd</TT> system consists of a server program and two different client programs (one for pushing and one for pulling). In addition, most Linux <TT>nntpd</TT> systems include a replacement for the <TT>inews</TT> program.</P>
<P>An alternative to <TT>nntpd</TT> is the INN (InterNetNews) package developed by Rich Salz. This is supplied with many Linux distribution packages, as well. INN allows both UUCP and network-based newsfeeds but is really designed for large machines. If you anticipate a lot of newsgroup access, INN may be a better choice than <TT>nntpd</TT>, although <TT>nntpd</TT> can handle full newsfeeds almost as well. Because of the relative scarcity of INN and its suitability to larger networks only, we’ll concentrate on <TT>nntpd</TT> in this chapter. If you want to know more about INN, read the documentation files that accompany the software or download them from an FTP or BBS site. An INN FAQ is frequently posted to the Linux newsgroups on Usenet.</P>
<P>When NNTP receives an article from a remote machine, it passes it on to one of the news subsystems that must be in place. Usually, this is <TT>rnews</TT> or <TT>inews</TT>. (You can also use NNTP for batching of articles, explained earlier in this chapter, in which case the <TT>relaynews</TT> program handles the batch of articles.) NNTP uses the <TT>/usr/lib/news/history</TT> file to properly perform some protocol transfers, so this file must be configured correctly.</P>
<H4 ALIGN="LEFT"><A NAME="Heading4"></A><FONT COLOR="#000077">Installing the NNTP Server Program</FONT></H4>
<P>The NNTP server, <TT>nntpd</TT>, is usually supplied as source code only, as mentioned earlier. Typically, it must be compiled on your machine to include machine-specific information. The configuration of <TT>nntpd</TT> is performed through a utility program usually stored as <TT>/usr/lib/news/common/conf.h</TT>. You can search for the program with the command:</P>
<!-- CODE SNIP //-->
<PRE>
find / -name conf.h -print
</PRE>
<!-- END CODE SNIP //-->
<P>Run this program (which is a number of macros) and answer all the questions about your system.
</P>
<P>Begin the NNTP installation process by creating a directory in which <TT>nntpd</TT> can store incoming articles. You should create this directory as <TT>/usr/spool/news/.tmp</TT> (or <TT>/var/spool/news/.tmp</TT>). The ownership of the directory must be set to <TT>news</TT>. The two commands to perform these steps are:</P>
<!-- CODE SNIP //-->
<PRE>
mkdir /usr/spool/news/.tmp
chown news.news /usr/spool/news/tmp
</PRE>
<!-- END CODE SNIP //-->
<P>The NNTP server can be configured in one of two different modes. The first is as a standalone server, which starts itself from the <TT>rc</TT>startup files (usually <TT>rc.inet2</TT>) when the Linux system is booted. Alternatively, <TT>nntpd</TT> can be configured to be managed through <TT>inetd</TT>, instead of running all the time.</P>
<P>If you are configuring <TT>nntpd</TT> to run as a standalone daemon, make sure there is no line in the <TT>/etc/inetd.conf</TT> file that calls the daemon (this is discussed in a moment). Check the <TT>/etc/inetd.conf</TT> file for potential conflicts with the <TT>nntpd</TT> daemon started in the <TT>rc</TT> files.</P>
<P>If you want to configure <TT>nntpd</TT> to run through <TT>inetd</TT>, which can reduce the overall load on your system except when news must be processed, you need to add an entry to the <TT>inetd</TT> configuration file, usually stored as <TT>/etc/inetd.conf</TT>. The following line should be added to this file with an ASCII editor:</P>
<!-- CODE SNIP //-->
<PRE>
nntp stream tcp nowait news /usr/etc/in.nntpd nntpd
</PRE>
<!-- END CODE SNIP //-->
<P>There may be a line like this already in the <TT>inetd.conf</TT> file, commented out. In this case, verify that the line reads the same as the one above and remove the comment symbol.</P>
<P>Whether you are configuring <TT>nntpd</TT> to run standalone or started by <TT>inetd</TT>, you also to need to verify that there is a line for the <TT>nntp</TT> service in the TCP <TT>/etc/services</TT> file. There should be a line like this</P>
<!-- CODE SNIP //-->
<PRE>
nntp 119/tcp readnews untp
</PRE>
<!-- END CODE SNIP //-->
<P>in the <TT>/etc/services</TT> file. It will probably be commented out when you install most versions of Linux, so remove the comment symbol.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="719-722.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="724-726.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -