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

📄 lsg40.htm

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


<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>

 -->


























<LINK REL="ToC" HREF="index.htm">







<LINK REL="Index" HREF="htindex.htm">







<LINK REL="Next" HREF="lsg41.htm">



















<A NAME="I0"></A>







<H2>Linux System Administrator's Survival Guide lsg40.htm</H2>







<P ALIGN=LEFT>







































<HR ALIGN=CENTER>







<P>







<UL>







<UL>







<UL>







<LI>







<A HREF="#E68E214" >How C News Handles News</A>







<LI>







<A HREF="#E68E215" >Configuring C News</A>







<UL>







<LI>







<A HREF="#E69E238" >C News Configuration Files</A>







<LI>







<A HREF="#E69E239" >C News Directories</A>







<LI>







<A HREF="#E69E240" >The sys File</A>







<LI>







<A HREF="#E69E241" >Implementing Batching</A>







<LI>







<A HREF="#E69E242" >Final Steps</A></UL>







<LI>







<A HREF="#E68E216" >C News Utilities</A>







<LI>







<A HREF="#E68E217" >Summary</A></UL></UL></UL>







<HR ALIGN=CENTER>







<A NAME="E66E45"></A>







<H1 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Chapter 40</B></FONT></CENTER></H1>







<BR>







<A NAME="E67E48"></A>







<H2 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>C News</B></FONT></CENTER></H2>







<BR>







<P>Probably the most widely used and most popular method of distributing news on Linux systems is C News, designed for UUCP connections (although you can use C News with NNTP, too). Configuring C News to transfer newsgroups between your machine and others is not too difficult, although it can be time-consuming. This chapter walks through the steps necessary to configure C News and explains most of the files that C News uses.







<BR>







<BR>







<A NAME="E68E214"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>How C News Handles News</B></FONT></CENTER></H3>







<BR>







<P>When news is transferred in from a remote newsfeed, the rnews program accepts it and stores it in a spooling directory (usually /usr/spool/news/in.coming or /var/spool/news/in.coming). From the spool directory, the news messages are picked up and processed by the newsrun program. Outgoing news (such as from a local user) is usually sent from the users' newsreader to the inews program, which completes all the header details and stores it ready for transfer in the directory /usr/spool/news/out.going (or /var/spool/news/out.going).







<BR>







<P>Both incoming and outgoing messages pass through the relaynews program, which is responsible for checking whether the message has already been seen on the local site. To do this, relaynews checks the message ID against the history file (which contains a list of all processed messages). If the message has already been accepted at the local site, it is discarded.







<BR>







<P>If the message is new, relaynews checks the Newsgroups heading of the message to verify that the local site accepts articles for that newsgroup. If the newsgroup is not supported, relaynews discards the message. If the newsgroup exists in the active file, relaynews moves the message into the proper newsgroup spool directory. If the newsgroup is not listed in the active file, the article is moved to a miscellaneous group (often called junk).







<BR>







<P>The relaynews program also checks the header information of messages to verify that they are not stale. If a stale article is found, it is discarded. If a message is not processed for any other reason (such as incomplete header, improper date, and so on), it is moved to the directory /usr/spool/news/in.coming/bad or /var/spool/news/in.coming.bad) and an error message logged. After all these checks, the message ID is logged to the history file.







<BR>







<P>Messages that are to be sent further on through a news network are checked against the Path field in the header to make sure they haven't already received the article. If they haven't, the message can be forwarded on using UUCP (or in rarer cases, NNTP).







<BR>







<P>If batching of news articles is in effect, incoming and new articles are not forwarded on to other news machines in the UUCP network immediately but are held until the batch is transferred as a whole. This is usually controlled through a crontab entry.







<BR>







<BR>







<A NAME="E68E215"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Configuring C News</B></FONT></CENTER></H3>







<BR>







<P>Configuring the C News system is a matter of verifying that necessary directories are accessible by C News, and that configuration files have valid values in them. Finally, all the file ownerships and permissions have to be checked. The configuration is best done in steps.







<BR>







<BR>







<A NAME="E69E238"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>C News Configuration Files</B></FONT></CENTER></H4>







<BR>







<P>To begin the configuration process for C News, obtain copies of the <I>active</I> and <I>newsgroup</I> files from your newsfeed. You can usually obtain the files with a UUCP command or an e-mail message to the postmaster at that site. Place the active and newsgroup files in the news directory (usually /usr/lib/news), and change the ownership to the user news. Next, change the file permissions to mode 644. You can do both these steps with the following commands:







<BR>







<PRE>







<FONT COLOR="#000080">chown news /usr/lib/news/active /usr/lib/news/newsgroup







chmod 644 /usr/lib/news/active /usr/lib/news/newsgroup</FONT></PRE>







<P>Edit the active file with any ASCII editor. Remove any line from the file that has the line &quot;to.*&quot;. Add two lines that add your machine name and newsfeed site names, so that you have lines like this:







<BR>







<PRE>







<FONT COLOR="#000080">to.merlin







to.brutus</FONT></PRE>







<P>These lines assume that your local site is called merlin and your feed site is called brutus. The order of the entries doesn't matter. These entries are used with the news ihave/sendme message system, and they should exist in the active file even if you are not using the ihave/sendme system.







<BR>







<P>Next, add the following lines to the /usr/lib/news/active file:







<BR>







<PRE>







<FONT COLOR="#000080">junk







control</FONT></PRE>







<P>These lines are used for handling unidentified newsgroup articles and other functions. Not all versions of C News let you access this file directly. Instead, two utilities called addgroup and rmgroup perform the same function. In this case, use the function addgroup to add the two lines.







<BR>







<BLOCKQUOTE>







<BLOCKQUOTE>







<HR ALIGN=CENTER>







<BR>







<NOTE>Whenever you or C News create a new entry in the active file, an entry is made in the file /usr/lib/news/active.times that indicates the name of the newsgroup, when it was created, who created it, and how it was done. Newsreaders often use this file to detect new newsgroups, but it can also serve as a handy log of newsgroup creation for system administrators.</NOTE>







<BR>







<HR ALIGN=CENTER>







</BLOCKQUOTE></BLOCKQUOTE>







<P>The /usr/lib/news/active file lists all groups that are known to exist (and are wanted) at your site, as well as the article numbers that are currently on the system. The format of each line in the active file is as follows:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">newsgroup high low permission</FONT></PRE>







<P>In this format, newsgroup is the name of the newsgroup, high and low are the highest and lowest article numbers that are on your system, although C News doesn't update this field automatically. To update this field (which many newsreaders require to properly track article threads), you need to run the updatemin program that accompanies most recent versions of C News (older versions of C News have a program called upact instead). When the numbers are incorrect (high lower than low, or high missing), the default is to set high to low+1.







<BR>







<P>The permission field gives the access system users have for the group. The permission is one of the following values:







<BR>















<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







=







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







This value marks the newsgroup as having an alias, followed by the name of the local alias. For example, the entry =naughty_stuff would post any articles sent to the newsgroup to a local newsgroup alias named naughty_stuff.</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







m







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







This value indicates a moderated newsgroup. Articles posted to a moderated newsgroup are e-mailed to the moderator. The moderator's address is in the file /usr/lib/news/moderators.</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







n







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







With this value, users are not allowed to post to the group, but they can read articles can be read.</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







x







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







The value means that the group is disabled (no reading allowed), although articles can still be forwarded to other machines.</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







y







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







This value means that users can post to the newsgroup.</FONT>







</TABLE><P>Finally, you have to renumber all the article numbers in the second and third fields of the new /usr/lib/news/active files to 0 (starting article number) and 1 (ending article number), so that you will receive all the articles properly. This process requires a lot of manual editing, or you can perform the entire process with one sed command (which is best performed on a copy of the original active file):







<BR>







<PRE>







<FONT COLOR="#000080">cp active active.original







sed 's/ [0-9]* [0-9]* / 0000000000 00001 /' active.original &gt; active</FONT></PRE>







<P>Manually check the new active file to make sure that the format of the file is correct. The entire second column should be a set of zeros, and the third column should be the number one.







<BR>





⌨️ 快捷键说明

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