Home » , » Installing the INN Server

Installing the INN Server

Written By Sajib Barua on Tuesday, August 21, 2012 | 2:45 AM

previous Managing Mail and News Servers in Linux

This section describes how to configure InterNetNews (INN), a TCP/IP-based news server. First you have to install INN.

In Debian, Ubuntu, and Xandros, type dpkg -l inn* to see if inn is installed. In Fedora and SUSE, type rpm -q inn and see if the inn package is installed.

In Debian and Ubuntu, type apt-get install inn to install the INN server. In Fedora, log in as root, mount the DVD, and type cd /media/ cdrom/Fedora/RPMS followed by rpm -ivh inn*. In SUSE, click Software Management in the YaST Control Center’s Software category. Then use YaST’s search feature to look for inn, select the relevant packages from the search results, and install them. In Xandros, first run Xandros Networks, choose Edit»Set Application Sources, and click the Debian Unsupported Site link as a source. Then type apt-get install inn to install the INN server.

Configuring and Starting the INN Server

Much of the INN (InterNetNews) software is ready to go as soon as you install it. All you need to do is to brush up a bit on the various components of INN, edit the configuration files, and start innd — the INN server. The INN server is sometimes referred to as the news server.

If you want to run a news server that supports a selection of Internet newsgroups, you also have to arrange for a news feed — the source from which your news server gets the newsgroup articles. Typically, you can get a news feed from an ISP, but the ISP charges an additional monthly fee to cover the cost of resources required to provide the feed. (Your normal ISP charges cover reading news from the ISP’s server; you have to pay additional charges only if you want to run your own server and get a news 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.

By the way, you don’t need an external news feed if you’re running a news server to support local newsgroups that are available only within your organization’s network. How to set up local newsgroups is described in the “Setting Up Local Newsgroups” section of this chapter.

Depending on the newsgroups you want to receive and the number of days you want to retain articles, you have to set aside appropriate disk space to hold 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’re 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 sort and store properly in the /var/spool/news directory on your system.

The following sections introduce you to INN setup, but you can find out more about INN from the Internet Systems 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 find out more about INN and can access other resources at ISC’s INN Web page at www. isc.org/sw/inn/.

InterNetNews components

INN includes several programs that deliver and manage newsgroups. It also includes a number of files that control how the INN programs work. The most important INN programs are the following:

  • innd: Accepts connections from other feed sites, as well as from local newsreader clients, but it hands off local connections to the nnrpd. The news server. innd 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).
  • nnrpd: Handles requests from local newsreader clients. nnrpd is a special server invoked by innd.
  • 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.

The other vital components of INN are the control files. Most of these files are in the /etc/news directory of your Linux system, although a few are in the /var/lib/news directory. Between those two directories, you have more than 30 INN control files. Some 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 and a brief description of each.
  • /etc/news/readers.conf: Specifies hosts and users who 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 important control files.

The inn.conf file

The inn.conf file holds configuration data for all INN programs — which makes it 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 pound sign (#).

Most of the parameters in the default inn.conf file in the /etc/news directory do not require changes. You may want to edit one or more of the parameters shown in Table 2-2.

Table 2-2

The newsfeeds file

The newsfeeds file (found at /etc/news/newsfeeds) 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 a colon (:). Usually, the entries span multiple lines, and a backslash (\) at the end of the line continues a line to the next. Here’s what the four fields mean:

  • 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 . . . ) of names. If any of the names in this list appear in the Path line of an article, that article isn’t forwarded to the feed. You can use an exclude list if you don’t want to receive articles from a specific source.
  • The second field is 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 @ causes newsgroups matching that pattern to be dropped. A pattern that begins with an exclamation mark (!) means the matching newsgroups are not sent. The simple pattern-matching syntax used in INN configuration files is referred to as a wildmat pattern.
  • The third field is a comma-separated list of flags — fields that determine the feed-entry type and set certain parameters for the entry. You see numerous flags; type man newsfeeds and read the man page for more information about the flags.
  • 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 find 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 only 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 used as a prefix for 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/ lib/news/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 feeds. 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.

The incoming.conf file

The incoming.conf file describes which hosts are allowed to connect to your host to feed articles. For a single feed, you can add an entry like

peer mybuddy {
hostname: a-feed-site.domain.com
}

where mybuddy is a label for the peer and a-feed-site.domain.com identifies the site that feeds your site.

Keep in mind that simply adding a site’s name in the incoming.conf file does not cause that remote site to start feeding news to your site; it simply enables your server to accept news articles from the remote site. At the remote site, your buddy has to configure his or her server to send articles to your site.

The readers.conf file

The readers.conf file specifies the host names 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 from any 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
}

InterNetNews startup

In addition to the configuration files, you also have to initiate cron jobs that perform periodic maintenance of the news server. In Fedora, these cron jobs are already set up. Therefore, you’re 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 find out more about these commands. To create an initial history database, associated indexes, and set the ownerships and permissions of some files, type the following commands:

/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

To start innd in Fedora, log in as root and type /etc/init.d/innd start. (Alternatively, you can type service innd start.) In Debian, SUSE, Ubuntu, and Xandros, type /etc/init.d/inn start. To ensure that innd starts at boot time, type chkconfig --level 35 innd on in Fedora and chkconfig --level 35 inn on in SUSE. In Debian and Xandros, type update-rc.d inn defaults.

If you make any changes to the INN configuration files, remember to restart the server by invoking the /etc/init.d script with restart as the argument.

Setting Up Local Newsgroups

If you want to use newsgroups as a way to share information within your company, you can set up a hierarchy of local newsgroups. Then you can use these newsgroups to create virtual communities within your company, where people with shared interests can informally discuss issues and exchange knowledge.

Defining a newsgroup hierarchy

The first task is to define a hierarchy of newsgroups, deciding what each newsgroup discusses. For example, if your company name is XYZ Corporation, here’s a partial hierarchy of newsgroups you might define:

  • xyz.general: General items about XYZ Corporation

  • xyz.weekly.news: Weekly news

  • xyz.weekly.menu: The weekly cafeteria menu and any discussions about it

  • xyz.forsale: A listing of items offered for sale by employees

  • xyz.jobs: Job openings at XYZ Corporation

  • xyz.wanted: Wanted (help, items to buy, and so on) postings by employees

  • xyz.technical.hardware: Technical discussions about hardware

  • xyz.technical.software: Technical discussions about software

Updating configuration files

Following are the steps you follow to update the configuration files for your local newsgroups and restart the news server:

  1. Add descriptive entries for each newsgroup to the /var/lib/news/newsgroups file.

    Add to this file a line for each local newsgroup — type its name followed by a brief description. For example, here’s what you might add for the xyz.general newsgroup:

    xyz.general General items about XYZ Corporation

  2. Edit the ME entry in the /etc/news/newsfeeds file and add the phrase ,!xyz.* to the comma-separated list of newsgroup patterns.

    This step ensures that your local newsgroups are not distributed outside your site.

  3. Add a storage method to use for the local newsgroups.

    For example, you can add the following lines in /etc/news/storage. conf to define the storage method for the new xyz hierarchy of newsgroups (change xyz to whatever you name your local newsgroups):

    method tradspool {
    class: 1
    newsgroups: xyz.*
    }

  4. To make these changes effective, restart the news server.

    Type service innd restart in Fedora or /etc/init.d/inn restart in Debian, SUSE, Ubuntu, and Xandros.)

Adding the newsgroups

The final step is to add the newsgroups. After you update the configuration files and run innd, adding a local newsgroup is easy. Log in as root and use ctlinnd to perform this task. For example, here’s how you add a newsgroup named xyz.general:

/usr/lib/news/bin/ctlinnd newsgroup xyz.general

That’s it! That command adds the xyz.general newsgroup to your site. If you use the traditional storage method, the innd server creates the directory /var/spool/news/articles/xyz/general the first time an article is posted and stores articles for that newsgroup in that directory.

After you create all the local newsgroups, users from your intranet can post news articles and read articles in the local newsgroups. If they have problems accessing the newsgroups, make sure that the /etc/news/readers. conf file contains the IP addresses or names of the hosts that have access to the innd server.

Testing your newsgroups

For example, add a newsgroup named local.news on an INN server running on your Linux system by using the instructions explained in the previous sections. Then start a newsreader and set up a new news account with the news server set to the INN server. Then access the local.news newsgroup. Try it! You’ll like it.

next Managing DNS in Linux

Share this article :

0 comments:

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Linux - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger