Red Hat Linux 9 Professional Secrets [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Red Hat Linux 9 Professional Secrets [Electronic resources] - نسخه متنی

Naba Barkakati

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


Configuring and Starting the INN Server


So far, you have seen how to read news from an existing news server. Now, you can turn to the subject of setting up an INN server on your system. Much of the InterNetNews (INN) software, bundled with Red Hat Linux, is already set up for you. You need to understand the various components of INN, edit the configuration files, and start innd-the INN server. Sometimes I refer to the INN server as the news server.








Secret


If you want to support a selection of Internet newsgroups, you also have to arrange for a news feed-this is the source from which your news server gets the newsgroup articles. Typically, you can get a news feed from an ISP, for an additional monthly fee, to cover the cost of resources required to provide the feed. You need the name of the upstream server that provides the news feed, and you have to provide that server with your server's name and the newsgroups you want to receive.

Based on the newsgroups you want to receive and the number of days you want to retain articles, you have to set aside disk space for the articles. The newsgroups are stored in a directory hierarchy (based on the newsgroup names) in the

/var/spool/news directory of your system. If you are setting up a news server, you may want to devote a large disk partition to the

/var/spool/news directory.

In your news server's configuration files, enter the name of the server providing the news feed. At the same time, add to the configuration files the names of any downstream news servers, if any, that receive news feeds from your server. Then, you can start the news server and wait for news to arrive. Monitor the log files to ensure that the news articles are being sorted and stored properly in the

/var/spool/news directory on your system.

Once you have news up and running, you must run news maintenance and cleanup scripts. These are run using the cron jobs (see Chapter 20 for more information about cron jobs). On Red Hat Linux, a cron job is already set up to run the

/usr/lib/ news/bin/news.daily script to perform the news maintenance tasks.






Insider Insight

The following sections introduce you to INN setup, but you can learn more about INN from the Internet Software Consortium (ISC), a nonprofit corporation dedicated to developing and maintaining open source Internet software, such as BIND (an implementation of Domain Name System), DHCP (Dynamic Host Configuration Protocol), and INN. Rich Salz originally wrote INN; ISC took over the development of INN in 1996. You can learn more about INN and can access other resources at ISC's INN Web page (

http://www.isc.org/products/INN/ ).













Taking Stock of INN Components


INN includes several programs that perform specific newsgroup-delivery and -management tasks. It also includes a number of files that control how the INN programs work. The most important INN programs are the following:



  • innd-The news server. It runs as a daemon-a background process that keeps itself running to provide a specific service-and listens on the NNTP port (TCP port 119). The innd server accepts connections from other feed sites, as well as from local newsreader clients, but it hands off local connections to the nnrpd.



  • nnrpd-A special server invoked by innd to handle requests from local news-reader clients.



  • expire-Removes old articles based on the specifications in the text file

    /etc/news/expire.ctl .



  • nntpsend-Invokes the innxmit program to send news articles to a remote site by using NNTP. The configuration file

    /etc/news/nntpsend.ctl controls the nntpsend program.



  • ctlinnd-Enables you to control the innd server interactively. The ctlinnd program can send messages to the control channel of the innd server.










Secret


Some of the important components of INN are its control files. Most of these files are in the

/etc/news directory of your Red Hat Linux system, but a few are in the

/var/lib/news directory also. Between the two directories, there are over 30 INN control files. Some of the important files include the following:



  • /etc/news/inn.conf-Specifies configuration data for the innd server. (To view online help for this file, type man inn.conf.)



  • /etc/news/newsfeeds-Specifies what articles to feed downstream to other news servers. (The file is complicated, but you can get help by typing

    man newsfeeds .)



  • /etc/news/incoming.conf-Lists the names and addresses of hosts that provide news feeds to this server. (To view online help for this file, type man incoming.conf.)



  • /etc/news/storage.conf-Specifies the storage methods to be used when storing news articles. (To view online help for this file, type man storage.conf.)



  • /etc/news/expire.ctl-Controls expiration of articles, on a per newsgroup level, if desired. (To view online help for this file, type man expire.ctl.)



  • /var/lib/news/active-Lists all active newsgroups, showing the oldest and newest article number for each, and each newsgroup's posting status. (To view online help for this file, type man active.)



  • /var/lib/news/newsgroups-Lists newsgroups, with a brief description of each.



  • /etc/news/readers.conf-Specifies hosts and users are permitted to read news from this news server and post news to newsgroups. The default file allows only the localhost to read news; you have to edit it if you want to allow other hosts in your local area network to read news. (To view online help for this file, type man readers.conf.)













The next few sections describe how to set up some of the control files.


Understanding inn.conf


This file holds configuration data for all INN programs and, as such, is the most important file. Each line of the file has the value of a parameter in the following format:

parameter:     value

Depending on the parameter, the value is a string, a number, or

true or

false . As in many other configuration files, comment lines begin with a number or pound sign (

# ).

Most of the parameters in the default

inn.conf file in the

/etc/news directory should not require changes. You might want to edit one or more of the parameters shown in Table 16-2.










































Table 16-2: Configuration Parameters in /etc/news/inn.conf


Parameter Name


Description


mta


Set this to the mail transfer agent that will be used by innd to transfer messages. The default is to use sendmail.


organization


Set this to the name of your organization in the way you want it to appear in the

Organization: header of all news articles posted from your system. Users may override this by defining the

ORGANIZATION environment variable.


ovmethod


Sets the type of overview storage method (the overview is an index of the news articles in the newsgroup). The default method is

tradindexed , which is fast for reading news, but slow for storing news items.


pathhost


Set this to the name of your news server as you want it to appear in the

Path header of all postings that go through your server. If

pathhost is not defined, the fully qualified domain name of your system is used.


pathnews


Set this to the full pathname of the directory that contains INN binaries and libraries. In Red Hat Linux,

pathnews is set to

/usr/lib/news .


domain


Set this to the domain name for your server.


allownewnews


Set this to true if you want INN to support the

NEWNEWS command from news readers. Because this command can drastically reduce your server's performance, INN documentation recommends that you set this to

false .


storageapi


Set this to true if you want articles to be stored using the Storage Manager application programming interface (API). The default setting of false causes INN to use the traditional article storage method of storing one article per file. If you set this to

true , you have to choose between the storage methods

timehash and

cnfs , and you have to create new spool and database files (type man storage.conf to read more about

cnfs and

timehash storage methods). For a small number of newsgroups, you can leave this option at its default value of

false .


hiscachesize


Set this to the size in kilobytes that you want INN to use for caching recently used history file entries. The default setting of

0 disables history caching. Because history caching can greatly increase the number of articles your server can process per second, you may want to set a value of 256 (for 256KB).


innflags


Set this to any flags you want to pass to the INN server process when it starts up.




Understanding News Feeds


The

newsfeeds file specifies how incoming news articles are redistributed to other servers and to INN processes. If you provide news feeds to other servers, you have to list these news feeds in this file. (You also must have an entry labeled

ME , which serves a special purpose explained later in this section.)

The

newsfeeds file contains a series of entries, one for each feed. Each feed entry has the following format:

site[/exclude,exclude...]:pattern,pattern...
[/distrib,distrib...]:flag,flag...:param

Each entry has four fields separated by colons (

: ). Usually, the entries span multiple lines, and a backslash (

\ ) at the end of the line is used to continue a line to the next. Following are the four fields in each entry in the

newsfeeds file:



  1. The first field, site, is the name of the feed. Each name must be unique, and for feeds to other news servers, the name is set to the hostname of the remote server. Following the name is an optional slash and an exclude list (

    /exclude,exclude... ) consisting of a list of names. If any of the names in this list appear in the Path line of an article, that article will not be forwarded to the feed. You can use an exclude list if you don't want to receive articles from a specific source.



  2. The second field consists of a comma-separated list of newsgroup patterns, such as

    *,@alt.binaries.warez.*,!control*,!local* , followed by an optional distribution list. The distribution list is a list of comma-separated keywords, with each keyword specifying a specific set of sites to which the articles are distributed. The newsgroup patterns essentially define a subscription list of sites that receive this news feed. An asterisk (

    * ) matches all newsgroups. A pattern beginning with an

    @ causes newsgroups matching that pattern to be dropped. A pattern that begins with an exclamation mark (

    ! ) means the matching newsgroups are not sent. By the way, the simple pattern-matching syntax used in INN configuration files is referred to as a wildmat pattern.



  3. The third field is a comma-separated list of flags. These flags determine the feed-entry type and set certain parameters for the entry. There are numerous flags; you should type man newsfeeds and read the man page for more information about the flags.



  4. The fourth field is for parameters whose values depend on the settings in the third field. Typically, this field contains names of files or external programs that the INN server uses. You can learn more about this field from the newsfeeds man page.



Now that you know the layout of the

/etc/news/newsfeeds file, you can study that file as an example. The default file contains many sample feed entries, but all but the following two are commented out:



  • ME is a special feed entry that's always required. It serves two purposes. First, the newsgroup patterns listed in this entry are preprended to all newsgroup patterns in all other entries. Second, the

    ME entry's distribution list determines what distributions your server accepts from remote sites.



  • The

    controlchan feed entry is used to set up INN so that an external program is used to handle control messages (these messages are used to create new newsgroups and remove groups). For example, the following

    controlchan entry specifies the external program

    /usr/bin/controlchan to handle all control messages, except cancel messages (meant for canceling an article):

    controlchan!:!*,control,control.*,!control.cancel:Tc,Wnsm:/usr/lib/news/bin/controlchan



In addition to these feed entries, you add entries for any actual sites to which your news server provides news feed. Such entries have the format

feedme.domain.com:!junk,!control/!foo:Tm:innfeed!

where

feedme.domain.com is the fully qualified domain name of the site to which your system sends news articles.


Understanding incoming.conf


The

incoming.conf file describes which hosts are allowed to connect to your host to feed articles (in versions of INN prior to 2.2.3, a file named

hosts.nntp was used to specify remote hosts allowed to transfer articles to the local site). For a single feed, you can add an entry like

peer myfeed {
hostname: myfeedsite.com
}

where

myfeed is a label for the peer and

myfeedsite.com identifies the peer-the site that feeds your site.






Insider Insight

Keep in mind that simply adding a site's name in the

incoming.conf file does not cause that remote site to start feeding your site news-it simply enables your server to accept news articles from the remote site. At the remote site, the server must be configured to send articles to your site.



Understanding readers.conf


This file specifies the hostnames or IP addresses from which newsreader clients (such as Mozilla) can retrieve newsgroups from your server. For example, the following

readers .conf file allows read access and post access (meaning you can submit articles) from localhost and any from host in the network 192.168.0.0:

auth "localhost" {
hosts: "localhost, 127.0.0.1, stdin"
default: "<localhost>"
}
access "localhost" {
users: "<localhost>"
newsgroups: "*"
access: RPA
}
auth "localnet" {
hosts: 192.168.0.0/24
default: "<localnet>"
}
access "localnet" {
users: "<localnet>"
newsgroups: "*"
access: RPA
}


Starting INN


In addition to the configuration files, you also need to initiate cron jobs that perform periodic maintenance of the news server. In Red Hat Linux, these cron jobs are already set up. Therefore, you are now ready to start the INN server-innd.

Before you start innd, you must run

makehistory and

makedbz to initialize and rebuild the INN history database. Type man makehistory and man makedbz to learn more about these commands. You can use the following commands to create an initial history database and associated index:

/usr/lib/news/bin/makehistory -b -f history -O -l 30000 -I
cd /var/lib/news
/usr/lib/news/bin/makedbz -s `wc -l < history` -f history
chown news.news *
chown news.news /var/spool/news/overview/group.index
chmod 664 /var/spool/news/overview/group.index

As with any other standalone servers (these are servers that do not run under

xinetd ) in Red Hat Linux, you can set up innd to start at boot time by typing the following command:

chkconfig --level 35 innd on

To start innd right now, log in as

root and type the following command:

service innd start

If you change any configuration file (such as

inn.conf or

newsfeeds ), restart the innd server with the following command:

service innd restart

You can type ps ax to see if the innd process is up and running. If all goes well, you should see two processes such as the following listed in the output of the

ps ax command:

23789 ?        S      0:00 /usr/lib/news/bin/innd -p4
23794 ? S 0:00 /usr/bin/perl /usr/lib/news/bin/controlchan






Insider Insight

The

/var/log/spooler file contains all status and error messages from innd. Type the following command to see the last few messages in that file:

tail /var/log/spooler


/ 341