The most popular conventional news server on Linux today is InterNetNews (INN; http://www.isc.org/products/INN/). This package actually consists of several programs that work together as a unified system. The core program is innd , which processes news articles and handles incoming connections. The nnrpd program takes over connections from news readers (as opposed to other news servers). INN initiates connections with other news servers using the innxmit program, which in turn uses nntpsend to do much of the work. Each of these programs has an associated configuration file; indeed, some use multiple files. The most basic configuration files usually reside in /etc/news , but some files are stored in /var/lib/news or elsewhere. INN is usually shipped with Linux distributions in a package called inn or some variant of that. This chapter describes INN version 2.2.2, but configuration for other INN 2. x -series packages should be virtually identical. Some distributions make INN dependent upon Cleanfeed, which is an add-on package that can automatically remove some types of spam from the news server. (Newsgroup spam is a major problem that most end users don't notice because of the automated spam cleaning that's so common today.) Obtaining a News FeedIf you want to run a news server that carries even part of Usenet, you need to obtain a news feed for the server, and configure your system to use that feed. The latter task is covered in the upcoming section, "Controlling Access," but the former deserves a few words, as well. NNTP is designed such that you can use just about any existing news server as a feed. The trouble is that you can't simply enter some random news server in a configuration file and expect the feed to work; most news servers accept feeds only from selected sites. You must therefore locate a site that will agree to serve as your news feed. Indeed, you might need to locate multiple feeds if you can't find a single site that can provide all the newsgroups you want to carry. One place to start looking for a news feed is with whoever provides your network connectivity ”your ISP. Assuming you have a connection fast enough to support a full news feed, your ISP might be willing to feed your news server, or at least give you a pointer to some potential providers. Many ISPs, though, don't provide news feeds to their customers. This is particularly common for ISPs that sell primarily to residential and small business customers, and such customers seldom have enough bandwidth to handle the news feed in any event. Another potential source of news feeds is third-party news providers like those mentioned earlier. For instance, NewsGuy (http://www.newsguy.com) offers news feeds as well as access via news readers. A full news feed is likely to be costly, both in terms of a cash outlay for the service and in terms of the hardware and bandwidth required to support it. For instance, the NewsGuy feed costs $1200 a month in 2002, and the recommended hardware is a 400MHz Pentium with 500MB of RAM and 64GB of disk space, connected to a link with at least 3Mbps of bandwidth. You'll also need bandwidth for the news readers that will connect to your server. Of course, the exact requirements may be higher or lower than this, depending upon the exact mix of newsgroups you want to carry, how long you want to retain posts, and so on. As a general rule, the requirements have gone up every year, so the values cited here are likely to be very inadequate in the not-too- distant future.
Configuring INNConfiguring INN involves setting many options in many different files. A default installation will probably set many of the options to reasonable values, but you'll have to adjust some settings to fit your own system. For instance, you must define your newsgroups and set up access control features. (If you want to run a full Usenet server, your news feed may be able to provide you with help on control files relating to newsgroups and access to their own server.) You must also set up message expiration policies and tell INN how to handle any special control messages it may receive (these may tell the server to cancel a message, add a new group , and so on). General ConfigurationThe main INN configuration file is /etc/news/inn.conf . This file sets options using the following syntax: optionname: value Many other INN configuration files use a similar syntax. Most of the options in inn.conf may be left at their default values. The most important options to change are the first few. These include:
There are many additional options in the inn.conf file, but these should have reasonable default values. Consult the inn.conf man page for further information about the meanings of these options. Setting Up NewsgroupsThe inn.conf file doesn't include any newsgroup definitions or descriptions. That task is left to two other configuration files: active and newsgroups , both of which are stored in the directory set by the pathdb option in inn.conf (normally /var/lib/news ). The active file contains a list of newsgroups that are supported on the system. Newsgroups appear one to a line in this file, and order doesn't matter. Each line contains four fields, separated by whitespace: newsgroup.name himark lowmark flag As you might expect, newsgroup.name is the name of the newsgroup, such as comp.os.linux.misc . The himark and lowmark fields specify the highest- and lowest -numbered posts in the group, respectively. These values begin at 0000000000 and 0000000001 , respectively, for a new group. (INN stores posts as individual files with filenames being sequential numbers corresponding to a local post number. This local post number is unrelated to the message ID, and is likely to be different from one news server to another.) The flag field contains a flag that denotes how the newsgroup is to be treated:
A news server that only supports local operations is likely to have just a few news groups. You can call these whatever you like, but following the tiered naming convention of Usenet makes sense. For instance, you might create all your local groups in a hierarchy that's named after your organization, like threeroomco.support , threeroomco.support.bigproduct , and threeroomco.accounting for three discussion groups at threeroomco.com . If you acquire a news feed from an outside source, that source should be able to provide you with a list of newsgroups, or even a complete active file, that you can use. As your news server operates, INN will modify the himark and lowmark fields of the active file. As articles are added, the himark value will increase. As older articles are expired , the lowmark value will increase, although it may not change with every expiration or cancellation ”as described later, articles may not expire in exactly the order in which they're created. The newsgroups file is less critical to day-to-day operation of the news server than is the active file. Like the active file, the first field of each line of newsgroups is the name of the newsgroup. After this group name comes one or more tabs and a description of the newsgroup. Clients can retrieve this file to help users locate groups, or differentiate between two groups whose names are similar. Controlling AccessMost sites restrict access to their news servers to prevent abuse and conserve their network resources. There are three aspects to this configuration: feeding news to other sites, restricting access for news feeds, and restricting access for news clients. The first two options are important mainly when your news server exchanges messages with others, but even if you operate a standalone news server, you should check that it's not configured to accept exchanges with other news servers, to avoid abuse. Configuration for news clients is important for all news servers Feeding News to Other SitesIf you want messages posted by your users to reach other sites, or if you've arranged to feed entire newsgroups to some other site, you need to configure your system to contact other news servers to send messages on their way. This is controlled through the /etc/news/newsfeeds file, which contains lines of the following format: sitename: pattern [, pattern... ]: flag [, flag... ]: param These lines can become quite long, so you can split lines by using the backslash ( \ ) line continuation character ”any line that ends in a backslash is continued on the following line, so you can break a very long line across multiple lines for ease of reading and editing. Each of the colon -delimited fields has a specific meaning, as follows :
The newsfeeds file controls the creation of a file that will ultimately be transmitted to another site. The /etc/news/nntpsend.ctl file controls how INN contacts that site. Like newsfeeds , nntpsend.ctl consists of four colon-delimited fields: sitename: site.host.name: max_size: [ args ] The sitename is the name of the site from the newsfeeds file, and the site.host.name is the site's conventional hostname. You can restrict the amount of data you'll pass in a single transfer with the max_size argument; for instance, 2m limits transfers to 2MB or less. Finally, you can include optional arguments that are passed to the innxmit program, which does the actual transmission. Consult the innxmit man page for information on the arguments it accepts. You'll only need to deal with these configurations if you're feeding news to other sites, or if you want to set up a feed from another site. To be truly effective, a news feed from another site must accept posts that originate with your users. Without this reciprocal connection, posts from your users won't be available to readers on the Internet at large, just locally. Thus, although you may think of yourself as accepting an external news feed, you must configure your system to provide a feed to your feeder, as well as accepting its input. Setting News Feed AccessINN can control access to itself. The main daemon, innd , accepts connections from your feeder news sites and from various other programs in the INN package. Although innd handles the initial connection from news clients, it passes those connections to another program as quickly as possible. Therefore, the main innd connections control file, /etc/news/incoming.conf , should list only the local computer and news feeder sites. The basic unit in the incoming.conf file is a key/value pair, which is how you specify attributes and their values. These take the form key : value . These pairs may be collected into peers, which are specifications of individual computers. (Some key/value pairs are global in scope, though; they don't appear in peers.) Peers may also be collected into groups. Both peers and groups use curly braces ( {} ) to delimit their extent. Listing 12.1 shows a typical incoming.conf file for a site that uses one news feed. Listing 12.1 A sample incoming.conf file# Global settings streaming: true max-connections: 50 # Allow NNTP posting from localhost peer ME { hostname: "localhost, 127.0.0.1" } # Allow fiveroomco.com to send us most groups peer fiveroom { hostname: news.fiveroomco.com patterns: *,!threeroomco.* } The most important key is hostname , which specifies the hostname of the computer that's to be allowed a connection. You can list specific newsgroups that may be transferred using the patterns key, using the newsgroup-naming conventions of the newsfeeds file. The default is to accept all newsgroups fed by the remote system. Various other keys are described in the incoming.conf man page. Setting News Reader AccessChances are you want authorized users to be able to access your news server. Because innd delegates this task to another program, you don't configure news reader access in the incoming.conf file; instead, you use the /etc/news/nnrp.access file for this purpose. Each line in this file consists of five colon-delimited entries, thus: hostname: permissions: username: password: newsgroups The meanings of specific entries are as follows:
If you include multiple lines in the nnrp.access file, later lines take precedence over earlier ones. Thus, if you want to make global settings but provide exceptions for specific hosts, you should place the lines for the global settings earlier in the file. Setting Message Expiration OptionsThe /etc/news/expire.ctl file controls the automatic expiration (deletion) of messages. Most of the lines in this file follow a pattern similar to that in other configuration files, with five colon-delimited fields: pattern: modflag: keep: default: purge The meanings of these fields are as follows:
Ongoing News Server MaintenanceINN normally runs directly as a daemon, started by SysV startup scripts as described in Chapter 4, Starting Servers. If you installed INN from a package included with your distribution, you should be able to start it by running such a startup script. Some of the tasks described earlier, such as sending messages to other servers and expiring articles, aren't handled automatically by innd as it runs in normal operation. Instead, these tasks are controlled by scripts or utility programs that are called by cron. If you installed INN from a package that came with your distribution, chances are that it created appropriate configuration files to have these tasks occur automatically by placing crontab files in /etc/cron.d , /etc/cron . interval , or some other location. If you want to change the frequency with which these tasks occur, you should check these locations or use your package manager to find out what cron files were placed where. You can then modify, move, or delete the files, and if necessary create new ones to take over these tasks. Other server maintenance tasks involve modifying your configuration. For instance, you may need to add a new newsgroup, delete an existing newsgroup, or temporarily disable access to the server. These tasks can be accomplished with the ctlindd utility, which accepts a large number of options. Type ctlindd -h to view a list of its options. |