Download Guia de Administracion

Transcript
Linux System Administrator’s Survival Guide
CHAPTER 39
NNTP and INN
Network News Transfer Protocol (NNTP) is often used for TCP-based newsfeeds. In other words, if you are using a network to connect to a newsfeed, you
can use NNTP to download your newsgroups instead of UUCP. Although UUCP users can use NNTP, the C News package is more popular and easier to
work with (see Chapter 40, "C News") for UUCP transfers as it leaves off the comlexities NNTP adds. The primary advantage of NNTP-based network
newsfeeds is the much higher throughput that can be achieved. UUCP is limited to modem speeds, but NNTP can function over fast local area networks at
many megabits per second. This capability allows for larger downloads in the same timespan, which can be important if you receive a lot of newsgroups.
NNTP is not a stand-alone package; it requires another news server system to be running. NNTP works with both the older B News (which is seldom
available for Linux now) and the better C News (discussed in the next chapter).
This chapter looks at how you can implement NNTP for a local area network news system. Although this chapter doesn't cover every NNTP option and
feature, the information presented here should be sufficient to get an NNTP feed working properly. The end of this chapter looks at INN (Internet News), an
alternate package for handling news. INN is a complex package capable of supporting very complex networks and news requirements, but it is often
overkill for small Linux systems.
How NNTP Handles News
NNTP operates in two modes: active and passive. The active mode, often called pushing, is much the same as C News' ihave/sendme protocol in which
the sender (server) offers a particular article and waits for the receiver (client) to accept or refuse the article. Pushing has a disadvantage for the server in
that it has a high overhead because each article must be checked in turn.
In the passive mode, called pulling, the receiving machine requests a list of all articles in a particular newsgroup that have arrived since a specified date.
This request is sent through a newnews command. When the receiving machine has all the articles, it then discards any that are duplicated or not wanted
using the article command. This mode is much easier for the sending machine because it simply sends a mass of articles, but the server does have to
make sure it sends information that is allowed to pass to the receiver for security's sake.
NNTP is implemented on a Linux system with the NNTP daemon developed by Stan Barber and Phil Lapsley. This daemon is known almost universally as
the reference implementation. Usually, you will only have the source code for the NNTP daemon, which is called nntpd, supplied with a Linux distribution
because several site-specific details must be linked into the binary. The nntpd system consists of a server program and two different client programs (one
for pushing and one for pulling). In addition, most Linux nntpd systems include a replacement for the inews program.
An alternative to nntpd is the INN (InterNet News) package developed by Rich Salz. This package is supplied with many Linux distribution packages. INN
allows both UUCP and network-based newsfeeds, but it is really designed for large machines. If you anticipate a lot of newsgroup access, INN may be a
better choice than nntpd, although nntpd can handle full newsfeeds almost as well.
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 subsystem is
rnews or inews. (You can also use NNTP for batching of articles, as explained in Chapter 40 "C News." In this case, the relaynews program handles the
batch of articles.) NNTP uses the /usr/lib/news/history file to properly perform some protocol transfers, so this file must be configured correctly (Chapter 40
explains how to configure this file).
Installing the NNTP Server Program
The NNTP server, which is called nntpd or in.nntpd, is usually supplied as source code only, as was previously mentioned. In most cases, you must
compile it on your machine to include machine-specific information. To configure nntpd, you use a program usually stored as /usr/lib/news/common/conf.h.
You can search for the source files with the command:
find / -name conf.h -print
Run this program (which is a number of macros) and answer all the questions about your system.
Begin the NNTP installation process by creating a directory for nntpd to store incoming articles. You should create this directory as /usr/spool/news/.tmp (or
/var/spool/news/.tmp). Set the ownership of the directory to news. The two commands to perform these steps are as follows:
mkdir /usr/spool/news/.tmp
chown news.news /usr/spool/news/tmp
You can configure the NNTP server in one of two different modes. The first mode is as a stand-alone daemon, which starts itself from the rc startup files
(usually rc.inet2) when the Linux system is booted. Alternatively, you can configure nntpd to be managed through inetd instead of running all the time.
If you are configuring nntpd to run as a stand-alone daemon, make sure that no line in the /etc/inetd.conf file calls the daemon. Alternatively, check the
/etc/inetd.conf file for potential conflicts if you start the nntpd daemon in the rc files.
To configure nntpd to run through inetd, which can reduce the overall load on your system except when news must be processed, you need to add an entry
to the inetd configuration file. This file is usually stored as /etc/inetd.conf. Add the following line to this file with an ASCII editor:
nntp stream tcp nowait news /usr/etc/in.nntpd nntpd
Página 290