📄 unx42.htm
字号:
<TD>
<P>
<BR>Talk newsgroups. Intended for people who like to argue in public about mostly unresolvable and controversial issues. The talk hierarchy is a great waste of time and users love it. Examples: talk.politics.mideast, talk.abortion.</P></TABLE>
<H4 ALIGN="CENTER">
<CENTER><A ID="I13" NAME="I13">
<FONT SIZE=3><B>Newsgroup Distributions</B>
<BR></FONT></A></CENTER></H4>
<P>Certain newsgroups and news postings are only relevant to certain geographical regions. For instance, it makes little sense to post an Indiana car-for-sale advertisement to the entire world, and Hungarian USENET sites won't appreciate the resources you
waste in doing so—it costs thousands of dollars to send an article to all of USENET. Distributions allow you to control how far your article travels. For instance, typically you can post an article to your local site, your state, your continent, or to
the entire world. News-posting programs usually offer users a choice of distributions as they construct their news postings. The news system administrator controls which distributions are presented to users, which distributions are accepted by the news
system when articles are brought in by its newsfeeds, and which distributions are offered to outside hosts. The latter is important for sites that want to keep their local distributions private.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I14" NAME="I14">
<FONT SIZE=3><B>Where News Articles Live</B>
<BR></FONT></A></CENTER></H4>
<P>News articles are stored in subdirectories of the news spool, which is usually named /var/spool/news or /usr/spool/news. The files that contain articles are given serial numbers as they are received, with the periods in the newsgroup names replaced by
the slash character (/). For instance, article number 1047 of the newsgroup comp.unix.solaris would be stored in the file /var/spool/news/comp/unix/solaris/1047. Articles in the news spool directory can be read with newsreaders and shared with other hosts
in your domain by using a network file system or the Network News Transfer Protocol (NNTP).
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I15" NAME="I15">
<FONT SIZE=3><B>The User Interface—Newsreaders and Posting Programs</B>
<BR></FONT></A></CENTER></H4>
<P>Newsreaders are the user interface to reading news. Since news articles are stored as ordinary files, you could use a program such as cat or more for your newsreading, but most users want something more sophisticated. Many newsgroups receive more than a
hundred articles a day, and most users don't have time to read them all. They want a program that helps them quickly reject the junk so they can read only articles of interest to them. A good newsreader enables users to select and reject articles based on
their Subject header; several provide even more sophisticated filtering capabilities. Some of the more popular newsreaders are rn (and its variant trn), nn, and tin. The GNU Emacs editor also has several packages (GNUS and Gnews) available for newsreading
from within Emacs. These newsreaders are available for anonymous ftp from the host ftp.uu.net and others.
<BR></P>
<P>Newsreaders usually have built-in news-posting programs or the capability to call a posting program from within the newsreader. Most of them also let you respond to articles by e-mail.
<BR></P>
<P>Newsreaders are like religions and text editors—there are lots of them and no one agrees on which is best. Your users will probably want you to install them all, as well as whatever wonderful new one was posted to comp.sources.unix last week. If
you don't have much time for news administration, you may want to resist or suggest the users get their own sources and install private copies. Otherwise you can spend a lot of time maintaining newsreaders.
<BR></P>
<P>News-posting programs enable you to post your own articles. A news-posting program prepares an article template with properly formatted headers, and then calls the text editor of your choice (usually whatever is named in the EDITOR environment variable)
so you can type in your article. When you exit the editor, you're usually given the choice to post the article, edit it again, or quit without posting anything. If you choose to post the article, the news-posting program hands it to another news system
program, which injects it into the news-transport system and puts a copy in the news spool directory.
<BR></P>
<P>Newsreaders and news-posting programs are usually both included in the same package of software. For instance, if you install the rn package you will also install Pnews, its news-posting program.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I16" NAME="I16">
<FONT SIZE=3><B>The News Overview Database (NOV)</B>
<BR></FONT></A></CENTER></H4>
<P>Newsreaders (and users) have a difficult job. Remember that more than 100 MB of news is posted to USENET per day. That's about the same as a fairly thick novel every day of the year, without any holidays. Most people want to have their favorite
newsreader sift the wheat from the chaff and present them with only the articles they want to see, in some rational order.
<BR></P>
<P>To do this, newsreaders must keep a database of information about the articles in the news spool; for instance, an index of Subject headers and article cross-references. These are commonly known as threads databases. The authors of newsreaders have
independently developed different threads databases for their newsreaders, and naturally they're all incompatible with each other. For instance, if you install trn, nn, and tin, you must install each of their threads database maintenance programs and
databases, which can take a lot of CPU cycles to generate and may become quite large.
<BR></P>
<P>Geoff Collyer, one of the authors of C-news, saw that this was not good and created the News Overview Database (NOV), a standard database of information for fancy newsreaders. The main advantage of NOV is that just one database must be created and
maintained for all newsreaders. The main disadvantage is that it hasn't yet caught on with all the authors of news software.
<BR></P>
<P>If you're interested in NOV support, you must install news-transport software that has the NOV NNTP extensions (INN does) and newsreaders that can take advantage of it. According to the NOV FAQ, trn3.3 and tin-1.21 have built-in NOV support, and there
is an unofficial version (not supported by the author) of nn for anonymous ftp on the host agate.berkeley.edu in the directory ~ftp/pub/usenet/NN-6.4P18+xover.tar.Z.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I17" NAME="I17">
<FONT SIZE=3><B>Sharing News Over the Network</B>
<BR></FONT></A></CENTER></H4>
<P>If you have several hosts on a local area network (LAN), you'll want to share news among them to conserve disk space. As mentioned previously, if you carry all possible newsgroups your news spool will need about a gigabyte of disk space, more or less
depending on how long you keep articles online. A year from now, who knows how much you'll need? It makes more sense to add disk capacity to a single host than to add it to all your hosts.
<BR></P>
<P>There are two ways to share news over a LAN. If all of your hosts run a network file system such as Sun Microsystem's NFS or Transarc's AFS (Andrew File System), you can export the news host's spool directory to them and your newsreaders will probably
never know the difference. (News-posting programs may need special support.) However, this approach assumes that all of your hosts can run a network file system, which may not be true.
<BR></P>
<P>A second way is to use NNTP to transfer news from a single server host to client newsreaders and news-posting programs. The only requirements for the client hosts are that they be able to open up a TCP/IP connection over the network and have client
software that understands NNTP. Most common UNIX-based newsreaders and news-posting programs have built-in NNTP support, and there are many NNTP clients for non-UNIX operating systems such as DOS, VMS, VM/CMS, and others.
<BR></P>
<P>An NNTP daemon runs continuously on the news server host listening on a well-known port, just as the Simple Mail Transfer Protocol (SMTP) server listens on a well-known port for incoming e-mail connections. NNTP client programs connect to the NNTP
server and issue commands for reading and posting news articles. For instance, there are commands to ask for all the articles that have arrived since a certain date and time. A client newsreader can ask for those articles and display them to the user as
the NNTP server ships them over the network. Hosts with which you exchange news connect to the NNTP server's port and transfer articles to your host.
<BR></P>
<P>NNTP servers usually have some form of built-in access control so that only authorized hosts can connect to them—after all, you don't want all the hosts on the Internet to be able to connect to your news server.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I18" NAME="I18">
<FONT SIZE=3><B>Transferring News to Other Hosts</B>
<BR></FONT></A></CENTER></H4>
<P>When a posting program hands an article to the news system, it expects a copy of the article to be deposited in the local news spool (or the news spool of the local NNTP server), sent to other hosts, and eventually sent to the rest of USENET. Similarly,
articles posted on other USENET hosts should eventually find their way into the local (or NNTP server's) spool directory.
<BR></P>
<P>Figure 42.1 illustrates a simple set of connections between hosts transferring news. The incoming and outgoing lines emphasize that news is both sent and received between each set of hosts.
<BR></P>
<P>
<BR><B><A HREF="42unx01.gif">FIGURE 42.1 The USENET Flooding Algorithm. </A></B>
<BR></P>
<P>USENET news is transferred by a flooding algorithm, which means that when a host receives an article it sends it to all other hosts with which it exchanges news, and those hosts do the same. Now suppose that someone on host-b in Figure 42.1 posts a news
article.
<BR></P>
<P>Because of the flooding algorithm, host-b sends the article to host-a, host-c, and any other hosts with which it exchanges news. Host-c gets the article and does the same, which means it gives the same article to host-a, which may try to give it back to
host-b, which already has a copy of the article in its news spool. Further, since host-b gave host-a the article, it will try to give it to host-c, which already got it from host-b. It's also possible that host-a got a copy of the article from host-b
before host-c offered it and will want to give it to host-c. Just to keep the news administrator's life interesting, no one can say whether any other hosts will ship the same article back to host-b or host-c. (Well-behaved hosts should avoid transferring
articles back to the hosts from which they originally received them, but on USENET it's best to plan for worst-case behavior from another site's software.) How do these hosts know when articles are duplicates and should be rejected? Obviously they can't
compare a new article with every article currently in the spool directory.
<BR></P>
<P>The news system software uses two different methods to avoid duplicate articles. The first is the Path header, which is a record of all the hosts through which a news article has passed. The Path header is just a list of hosts separated by punctuation
marks other than periods, which are considered part of a hostname. A Path such as hst.gonzo.com,host-c.big.org!host-b.shark.com means that an article has been processed by each of the sites hst.gonzo.com, host-c.big.org and host-b.shark.com. Any of those
hosts can reject the article because their names are already in the path.
<BR></P>
<P>RFC 1036 says that the Path header should not be used to generate e-mail reply addresses. However, some obsolete software might try to use it for that. INN discourages this use by inserting the pseudo-host not-for-mail into the Path.
<BR></P>
<P>The second way in which news systems avoid duplicate articles is the message-identifier header, Message-ID. Here is a sample Message-ID header:
<BR></P>
<PRE>Message-ID: <CsuM4v.3u9@hst.gonzo.com></PRE>
<P>When a news article is created, the posting program or some other part of the news system generates this unique header. Since no two articles have the same Message-ID header, the news system can keep track of the message identifiers of all recent
articles and reject those that it has already seen. The news history file keeps this record, and news-transport programs consult the history file when they're offered news articles. Because the volume of news is so large, history files get big pretty fast
and are usually kept in some database format that allows quick access.
<BR></P>
<P>The history mechanism is not perfect. If you configure your news system to remember the message identifiers of all articles received in the past month, your history files may become inconveniently large. On the other hand, if a news system somewhere
malfunctions and injects two-month-old articles into USENET, you won't have enough of a history to reject those articles. Inevitably, no matter how long a history you keep, it won't be long enough and you'll get a batch of old, bogus articles. Your users
will complain. Such is life.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I19" NAME="I19">
<FONT SIZE=3><B>Host-to-host News-Transport Protocols</B>
<BR></FONT></A></CENTER></H4>
<P>As with electronic mail, in order to transfer news from host to host, both hosts much speak the same language. Most USENET news is transferred either with the UUCP (UNIX to UNIX Copy Protocol) or NNTP. UUCP is used by hosts that connect with modems over
ordinary phone lines, and NNTP is the method of choice for hosts on the Internet. As mentioned above, you should avoid UUCP if you can.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I20" NAME="I20">
<FONT SIZE=3><B>News-Transport System Configuration Files</B>
<BR></FONT></A></CENTER></H4>
<P>The news-transport system needs a lot of information about your site. Minimally, it must know with which hosts you exchange news, at what times you do so, and what transport protocol you use for each site. It has to know which newsgroups and
distributions your site should accept and which it should reject. NNTP sites must know which hosts are authorized to connect with them to read, post, and transfer news.
<BR></P>
<P>The news-transport system's configuration files provide this information. The news administrator must set up these files when installing the news system and must modify them in response to changes, such as a new newsfeed. The format of news-transport
system control files varies, but all current systems provide detailed configuration documentation. Read it.
<BR></P>
<H3 ALIGN="CENTER">
<CENTER><A ID="I21" NAME="I21">
<FONT SIZE=4><B>Planning a News System</B>
<BR></FONT></A></CENTER></H3>
<P>You can see from the preceding discussion that there are many different strategies you can use to set up a news system. Because sites' needs vary, there is no single right way to do it. You must evaluate your site's needs and choose a strategy that
fits. The questions in this section are intended to make you think about some of the issues you should consider.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I22" NAME="I22">
<FONT SIZE=3><B>Do You </B><B><I>Really</I></B><B> Want to Be a USENET Site?</B>
<BR></FONT></A></CENTER></H4>
<P>As pointed out in the "how to join USENET" FAQ, you may not want to join at all. A news feed consumes significant CPU cycles, disk space, network (or modem) bandwidth, and staff time. Many Internet service providers will give your site access
to USENET news over the network through NNTP client newsreaders, and if your site is small this may be more economical than a news feed. Do yourself a favor and do the math before you jump in. You can always join USENET at a later date if you find that
your site's needs require a real feed.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I23" NAME="I23">
<FONT SIZE=3><B>Shared News versus One News Spool Per Host</B>
<BR></FONT></A></CENTER></H4>
<P>A basic decision is whether you will maintain separate news spools and news systems on all of your hosts, or designate a single host to act as a news server and let other hosts access news through the network. If you have more than one host to
administer, there are definite advantages to the latter approach.
<BR></P>
<P>If you have a single news host, your job as news administrator is much easier. Most news problems are confined to that host and you only have to maintain the (fairly complex) news transport software on that host. Software on client hosts is limited to
newsreaders and news-posting software—no news-transport software is necessary. If there are problems, you know where to go to solve them, and once you solve them on the news host they will be solved for all the hosts in your domain.
<BR></P>
<P>USENET volume helps make a single-host strategy attractive. As mentioned previously, a full news feed can easily require a gigabyte of disk space, and the volume of USENET news continues to grow seemingly without bound. It's a lot easier to convince
your boss to buy a bigger disk drive for a single host than for twenty. Since many users don't read news every day, the longer you can retain articles the happier they will be, and you can retain them longer on a single, dedicated news host than you can on
multiple hosts.
<BR></P>
<P>Economics point to using a single news host both to minimize expensive staff time and to conserve disk space. The only reason you might want to store news on multiple hosts is if your network isn't up to par—if your only network connections are
through UUCP, you can't use NNTP or a network file system to share news.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I24" NAME="I24">
<FONT SIZE=3><B>Isolating the News Spool</B>
<BR></FONT></A></CENTER></H4>
<P>Most UNIX systems use the file system /var to contain files that grow unpredictably. For instance, /var/mail contains user mailboxes and /var/log contains system log files. Since the news spool is usually located in /var/spool/news, news articles may
compete for space with potentially more important data such as e-mail. Having your e-mail system grind to a halt because someone posts his 10 MB collection of Madonna erotica will not endear you to your users or your boss.
<BR></P>
<P>The best way around this problem is to isolate the news spool in its own disk partition. If /var/spool/news is mounted on its own disk partition and it fills up, only the news system is affected.
<BR></P>
<P>The disadvantage of this approach is that it forces you to pre-allocate disk space. If you allocate too little to the news spool, you'll have to either expire articles sooner than you'd like or spend a lot of time fixing things by hand when the spool
directory fills. If you allocate too much, it can't be used by other file systems, so you waste space. (However, it's better to guess too big than too little. Remember that the volume of USENET news constantly increases.)
<BR></P>
<P>Depending on how flexible your UNIX is, if you guess wrong and have to resize your partitions, it may be painful. You will have to resize at least two adjoining disk partitions to shrink or enlarge the news spool, which means dumping all the data in the
partitions, creating new ones, and restoring the data. (A safer approach is to dump all the data on the disk and verify that you can read the backup tapes before you resize the partitions.) During this operation, the news system (and probably the computer)
will be unavailable.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I25" NAME="I25">
<FONT SIZE=3><B>Configuring Your News Spool's File System</B>
<BR></FONT></A></CENTER></H4>
<P>Before you can use a disk partition you must create a UNIX file system on it, using newfs, a front-end to the harder-to-user mkfs program. (Some versions of UNIX use mkdev fs to create file systems. Consult your system's administration manual.) Unless
you tell it otherwise, newfs uses its built-in default for the ratio of i-nodes (index-nodes) to disk blocks. I-nodes are pre-allocated, and when you run out of them no new files can be created, even if you have disk space available in the file system. The
newfs default for i-nodes is usually about right for most file systems but may not be for the news spool. News articles tend to be small, so you may run out of i-nodes in your news spool before you run out of disk space. On the other hand, since each
pre-allocated i-node takes some disk space, if you allocate too many you'll waste disk space.
<BR></P>
<P>Most likely you'll want to tell newfs to create additional i-nodes when you create your news spool. The hard question is how many additional i-nodes to allocate. If your news system is already running, you can use the df command to find out. Simply
compare the percentage of i-nodes in use to the percentage of disk blocks in use. If they are about the same, you're doing OK. If the disk block usage is a lot greater than the i-nodes in use, you've allocated too many i-nodes. What is more likely is that
you'll find the i-nodes in use greatly outnumber the available disk blocks. The solution is to shut down your news system, dump the news spool to tape, run newfs to make a file system with more i-nodes, and restore the news spool from tape.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I26" NAME="I26">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -