726-728.html

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

HTML
104
字号
<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=726-728//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="724-726.html">Previous</A></TD>

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

<TD><A HREF="../ch42/729-732.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading7"></A><FONT COLOR="#000077">Configuring trn</FONT></H4>

<P>The <TT>trn</TT> newsreader, widely used by UNIX users, is based on the classic newsreader <TT>rn</TT> (read news). The primary advantage to <TT>trn</TT> over <TT>rn</TT> is the ability to follow threads (articles that are related by subject). Most systems can run <TT>trn</TT>without any modifications to the files, unless they want to use threads.</P>

<P>To enable threads to be followed, <TT>trn</TT>needs to be able to construct a thread database, showing the interrelationships between articles. The <TT>trn</TT> newsreader can&#146;t do this itself, relying on a program called <TT>mthreads</TT> (usually stored as <TT>/usr/local/bin/rn/mthreads</TT>). The <TT>mthreads</TT> utility is best run in a <TT>crontab</TT> file at regular intervals (usually as often as you download full newsfeeds). Without <TT>mthreads</TT>, <TT>trn</TT> can still be used, but threads cannot be followed.</P>

<P>Without any arguments, <TT>mthreads</TT> generates index files for the thread databases only for newly arriving articles in all newsgroups. To index all the newsgroups from scratch, issue the command</P>

<!-- CODE SNIP //-->

<PRE>

mthreads all

</PRE>

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

<P>This command examines the <TT>/usr/lib/news/active</TT> file and reindexes every newsgroup in that file.</P>

<P>If you want to index only a few newsgroups, you can supply the newsgroup names as arguments (either in the <TT>crontab</TT> file or from the shell prompt). For example, the command</P>

<!-- CODE SNIP //-->

<PRE>

mthreads rec.auto.antique

</PRE>

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

<P>reindexes the <TT>rec.auto.antique</TT> thread database. You can reindex more than one newsgroup at a time by separating the names with a comma. You can also force entire hierarchies to be reindexed by specifying only the hierarchical name. For example, the command</P>

<!-- CODE SNIP //-->

<PRE>

mthreads alt

</PRE>

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

<P>reindexes all the <TT>alt</TT> newsgroups. If you want to exclude certain newsgroups, preface them with an exclamation mark. For example, this command</P>

<!-- CODE SNIP //-->

<PRE>

mthreads rec.auto,rec.audio,!rec.audio.tech

</PRE>

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

<P>reindexes all the <TT>rec.auto</TT> newsgroups, as well as all the <TT>rec.audio</TT> newsgroups except <TT>rec.audio.tech</TT>.</P>

<P>If your site has very heavy news traffic, you can run <TT>mthreads</TT> in daemon mode. This means <TT>mthreads</TT> doesn&#146;t have to be started at regular intervals and it immediately processes arriving articles. However, it does take system resources away. To set <TT>mthreads</TT> in daemon mode, use the <TT>-d</TT> option. By default, <TT>mthreads</TT> will check the newsgroups every 10 minutes. You can place this command in the <TT>rc</TT> startup files, if you want.</P>

<H4 ALIGN="LEFT"><A NAME="Heading8"></A><FONT COLOR="#000077">Configuring tin</FONT></H4>

<P>Unlike <TT>trn</TT>, the <TT>tin</TT> newsreader doesn&#146;t need to be told to reindex the thread databases at intervals. The <TT>tin</TT>newsreader generates the thread indexes every time a user enters a newsgroup. The reindexing is quite fast, unless the newsgroup has more than 500 articles or so.</P>

<P>When <TT>tin</TT> reindexes a newsgroup, it stores the index file under the user&#146;s home directory as .<TT>tin/index/newsgroup_name.</TT> The total size of all these index files can become quite sizable if a user reads a lot of newsgroups or if there are many users on the system. The easy way to prevent this is to force <TT>tin</TT>to keep a single master index in one location that all users can access. To set up a single index, set the owner of <TT>tin</TT> to news with the command</P>

<!-- CODE SNIP //-->

<PRE>

chown news.news tin

</PRE>

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

<P>(when you are in the <TT>tin</TT>directory, of course). This way, <TT>tin</TT>stores the index files under <TT>/usr/spool/news/.index</TT> (or <TT>/var/spool/news/.index</TT>).</P>

<P>You can install a daemon called <TT>tind</TT> that keeps the index files constantly updated. The <TT>tind</TT> daemon source code is supplied with some versions of Linux, but few have a compiled version, so you will need a compiler and the make utility to build a version for your system.</P>

<H3><A NAME="Heading9"></A><FONT COLOR="#000077">Summary</FONT></H3>

<P>Once you have completed the compilation and configuration of the NNTP system, as well as your newsreaders, you&#146;re set to go. There are quite a few new newsreaders appearing for Linux, such as <TT>nn</TT>, which is also a threaded newsreader. The choice of a reader is a matter of personal preference. Experiment and find the one you want to use.</P>

<P>From here, there are a number of related chapters that may be of interest to you. To learn how to</P>

<DL>

<DD>Secure your network from hackers, read Chapter 42, &#147;Network Security.&#148;

<DD>Back up all the configured software you&#146;ve installed, read Chapter 45, &#147;Backups.&#148;

<DD>Automate tasks like downloading news at night, read Chapter 46, &#147;<TT>cron</TT> and <TT>at</TT>.&#148;

</DL>

<P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="724-726.html">Previous</A></TD>

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

<TD><A HREF="../ch42/729-732.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





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

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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