chiark / gitweb /
debugging for thing that crashed
[inn-innduct.git] / doc / pod / install.pod
1 =head1 Welcome to INN 2.4!
2
3 Please read this document thoroughly before trying to install INN.  You'll
4 be glad you did.
5
6 If you are upgrading from a major release of INN prior to 2.3, it is
7 recommended that you make copies of your old configuration files and use
8 them as guides for doing a clean installation and configuration of 2.4.
9 Many config files have changed, some have been added, and some have been
10 removed.  You'll find it much easier to start with a fresh install than to
11 try to update your old installation.  This is particularly true if you're
12 upgrading from a version of INN prior to 2.0.
13
14 If you are upgrading from INN 2.3 or later, you may be able to just update
15 the binaries, scripts, and man pages by running:
16
17     make update
18
19 after building INN and then comparing the new sample configuration files
20 with your current ones to see if anything has changed.  If you take this
21 route, the old binaries, scripts, and man pages will be saved with an
22 extension of C<.OLD> so that you can easily back out.  Be sure to
23 configure INN with the same options that you used previously if you take
24 this approach (in particular, INN compiled with B<--enable-largefiles>
25 can't read the data structures written by INN compiled without that flag,
26 and vice versa).  If you don't remember what options you used but you have
27 your old build tree, look at the comments at the beginning of
28 F<config.status>.
29
30 If you made ckpasswd setuid root so that you could use system passwords,
31 you'll have to do that again after make update.  (It's much better to use
32 PAM instead if you can.)
33
34 If you use C<make update> to upgrade from INN 2.3, also look at the new
35 sample configuration files in F<samples> to see if there are new options
36 of interest to you.  In particular, F<control.ctl> has been updated and
37 F<inn.conf> has various new options.
38
39 For more information about recent changes, see F<NEWS>.
40
41 =head1 Supported Systems
42
43 As much as possible, INN is written in portable C and should work on any
44 Unix platform.  It does, however, make extensive use of mmap(2) and
45 certain other constructs that may be poorly or incompletely implemented,
46 particularly on very old operating systems.
47
48 INN has been confirmed to work on the following operating systems:
49
50     AIX 4.3
51     FreeBSD 2.2.x and up
52     HP-UX 10.20 and up
53     Linux 2.x (tested with libc 5.4, glibc 2.0 and up)
54     Mac OS X 10.2 and up
55     NetBSD 1.6 and up
56     OpenBSD 2.8 and up
57     SCO 5.0.4 (tested with gcc 2.8.1, cc)
58     Solaris 2.5.x and up
59     UnixWare 7.1
60     UX/4800 R11 and up
61
62 If you have gotten INN working on an operating system other than the ones
63 listed above, please let us know at <inn-bugs@isc.org>.
64
65 =head1 Before You Begin
66
67 INN requires several other packages be installed in order to be fully
68 functional (or in some cases, to work at all):
69
70 =over 2
71
72 =item *
73
74 In order to build INN, you will need a C compiler that understands ANSI C.
75 If you are trying to install INN on an operating system that doesn't have
76 an ANSI C compiler (such as SunOS), installing gcc is recommended.  You
77 can get it from <ftp://ftp.gnu.org/gnu/gcc/> or its mirrors.  INN is
78 tested with gcc more thoroughly than with any other compiler, so even if
79 you have another compiler available, you may wish to use gcc instead.
80
81 =item *
82
83 Currently, in order to build INN, you will need an implementation of yacc.
84 GNU bison (from <ftp://ftp.gnu.org/gnu/bison/> or its mirrors) will work
85 fine.  We hope to remove this requirement in the future.
86
87 =item *
88
89 INN requires at least Perl 5.004_03 to build and to run several
90 subsystems.  INN is tested primarily with newer versions of Perl, so it's
91 generally recommended that you install the latest stable distribution of
92 Perl before compiling INN.  For instructions on obtaining and installing
93 Perl, see <http://www.perl.com/pub/language/info/software.html>.  Note
94 that you may need to use the same compiler and options (particularly
95 largefile support) for Perl and INN.
96
97 If you're using a version of Perl prior to 5.6.0, you may need to make
98 sure that the Perl versions of your system header files have been
99 generated in order for Sys::Syslog to work properly (used by various
100 utility programs, including controlchan).  To do this, run the following
101 two commands:
102
103     # cd /usr/include
104     # h2ph * sys/*
105
106 An even better approach is to install Perl 5.6.1 or later, which have a
107 fixed version of Sys::Syslog that doesn't require this (as well as many
108 other improvements over earlier versions of Perl).
109
110 =item *
111
112 The INN Makefiles use the syntax C<include FILE>, rather than the syntax
113 expected by some BSDish systems of C<.include E<lt>FILEE<gt>>.  If your
114 system expects the latter syntax, the recommended solution is to install
115 GNU make from <ftp://ftp.gnu.org/make/>.  You may have GNU make already
116 installed as gmake, in which case using gmake rather than make to build
117 INN should be sufficient.
118
119 =item *
120
121 If you want to enable support for authenticated control messages (this is
122 not required, but is highly recommended for systems carrying public Usenet
123 hierarchies) then you will need to install some version of PGP.  The
124 recommended version is GnuPG, since it's actively developed, supports
125 OpenPGP, is freely available and free to use for any purpose (in the US
126 and elsewhere), and (as of version 1.0.4 at least) supports the RSA
127 signatures used by most current control message senders.
128
129 Alternately, you can install PGP from <http://www.pgp.com/> or one of the
130 international versions of it.  Be warned, however, that the licensing
131 restrictions on PGP inside the United States are extremely unclear; it's
132 possible that if you are installing INN for a company in the U.S., even if
133 the news server is not part of the business of that company, you would
134 need to purchase a commercial license for PGP.  For an educational or
135 non-profit organization, this shouldn't be a problem.
136
137 =item *
138
139 If you want to use either the Python embedded hooks, you'll need to have a
140 suitable versions of Python installed.  See F<doc/hook-python> for more
141 information.
142
143 =item *
144
145 Many of INN's optional features require other packages (primarily
146 libraries) be installed.  If you wish to use any of these optional
147 features, you will need to install those packages first.  Here is a table
148 of configure options enabling optional features and the software and
149 versions you'll need:
150
151     --with-perl         Perl 5.004_03 or higher, 5.6.1+ recommended
152     --with-python       Python 1.5.2 or higher
153     --with-berkeleydb   BerkeleyDB 2.0 or higher, 4.2+ recommended
154     --with-openssl      OpenSSL 0.9.6 or higher
155     --with-sasl         SASL 2.x or higher
156     --with-kerberos     MIT Kerberos v5 1.2.x or higher
157
158 If any of these libraries (other than Perl or Python) are built shared and
159 installed in locations where your system doesn't search for shared
160 libraries by default, you may need to encode the paths to those shared
161 libraries in the INN binaries.  For more information on shared library
162 paths, see:
163
164     <http://www.eyrie.org/~eagle/notes/rpath.html>
165
166 For most systems, setting the environment variable LD_RUN_PATH to a
167 colon-separated list of additional directories in which to look for shared
168 libraries before building INN will be sufficient.
169
170 =back
171
172 =head1 Unpacking the Distribution
173
174 Released versions of INN are available from ftp.isc.org in F</isc/inn>.
175 New major releases will be announed on <inn-announce@isc.org> (see
176 F<README>) when they're made.
177
178 If you want more a more cutting-edge version, you can obtain current
179 snapshots from from ftp.isc.org in directory F</isc/inn/snapshots>.  These
180 are snapshots of the INN CVS tree taken daily; there are two snapshots
181 made each night (one of the current development branch, and one of the
182 stable branch consisting of bug fixes to the previous major release).
183 They are stored in date format; in other words the snapshots from April
184 6th, 2000, would be named F<inn-CURRENT-20000406.tar.gz> and
185 F<inn-STABLE-20000406.tar.gz>.  Choose the newest file of whichever branch
186 you prefer.  (Note that the downloading, configuring, and compiling steps
187 can be done while logged in as any user.)
188
189 The distribution is in gzip compressed tar archive format.  To extract it,
190 execute:
191
192     gunzip -c <inn-src-file> | tar -xf -
193
194 Extracting the source distribution will create a directory named
195 F<< inn-<version> >> or F<< inn-<BRANCH>-<date> >> where the source
196 resides.
197
198 =head1 Installing INN
199
200 Before beginning installation, you should make sure that there is a user
201 on your system named C<news>, and that this user's primary group is set to
202 a group called C<news>.  You can change these with the B<--with-news-user>
203 and B<--with-news-group> options to configure (see below).  The home
204 directory of this user should be set to the directory under which you wish
205 to install INN (F</usr/local/news> is the default and is a good choice).
206 INN will install itself as this user and group.  You can change these if
207 you want, but these are the defaults and it's easier to stick with them on
208 a new installation.
209
210 By default, INN sends reports to the user C<usenet>.  This account isn't
211 used for any other purposes.  You can change it with the
212 B<--with-news-master> option to configure (see below).
213
214 WARNING: By default, INN installs various configuration files as
215 group-writeable, and in general INN is not hardened from a security
216 standpoint against an attack by someone who is already in the news group.
217 In general, you should consider membership in the news group as equivalent
218 to access to the news account.  You should not rely on being able to keep
219 anyone with access to the news GID from converting that into access to the
220 news UID.  The recommended configuration is to have the only member of the
221 group C<news> be the user C<news>.
222
223 Installing INN so that all of its files are under a single directory tree,
224 rather than scattering binaries, libraries, and man pages throughout the
225 file system, is strongly recommended.  It helps keep everything involved
226 in the operation of INN together as a unit and will make the installation
227 instructions easier to follow.
228
229 As a side note, whenever doing anything with a running news server, first
230 log in as this user.  That way, you can ensure that all files created by
231 any commands you run are created with the right ownership to be readable
232 by the server.  Particularly avoid doing anything in the news spool itself
233 as root, and make sure you fix the ownership of any created files if you
234 have to.  INN doesn't like files in the news spool owned by a user other
235 than the news user.  However, since certain binaries need to be setuid
236 root, indiscriminate use of C<chown news> is not the solution.  (If you
237 don't like to log in to system accounts, careful use of C<chmod g+s> on
238 directories and a umask of C<002> or C<007> may suffice.)
239
240 INN uses GNU autoconf and a generated configure script to make
241 configuration rather painless.  Unless you have a rather abnormal setup,
242 configure should be able to completely configure INN for your system.  If
243 you want to change the defaults, you can invoke the configure script with
244 one or more command line options.  Type:
245
246     ./configure --help
247
248 for a full list of supported options.  Some of the most commonly used
249 options are:
250
251 =over 4
252
253 =item B<--prefix>=PATH
254
255 Sets the installation prefix for INN.  The default is F</usr/local/news>.
256 All of INN's programs and support files will be installed under this
257 directory.  This should match the home directory of your news user (it
258 will make installation and maintenance easier).  It is not recommended to
259 set this to F</usr>; if you decide to do that anyway, make sure to point
260 INN's temporary directory at a directory that isn't world-writeable (see
261 B<--with-tmp-dir> below).
262
263 =item B<--with-db-dir>=PATH
264
265 Sets the prefix for INN database files.  The default is F<PREFIX/db>,
266 where PREFIX is F</usr/local/news> unless overridden with the option
267 above.  The history and active files will be stored in this directory, and
268 writes to those files are an appreciable percentage of INN's disk
269 activity.  The history file can also be quite large (requiring up to 2 GB
270 or more during nightly expire), so this is a common portion of INN to move
271 to a different file system.
272
273 =item B<--with-spool-dir>=PATH
274
275 Sets the prefix for the news spool (when using any storage method other
276 than CNFS) and the overview spool.  The default is F<PREFIX/spool>.  This
277 is another common portion of INN to move to a different file system (often
278 F</news>).
279
280 =item B<--with-tmp-dir>=PATH
281
282 Sets the directory in which INN will create temporary files.  This should
283 under no circumstances be the same as the system temporary directory or
284 otherwise be set to a world-writeable directory, since INN doesn't take
285 care to avoid symlink attacks and other security problems possible with a
286 world-writeable directory.  This directory should be reserved for the
287 exclusive use of INN and only writeable by the news user.  Usage is
288 generally light, so this is unlikely to need a separate partition.
289
290 It's also possible to set the paths for most other sections of the INN
291 installation independently; see C<./configure --help> and look for the
292 B<--with-*-dir>=PATH options.
293
294 =item B<--enable-largefiles>
295
296 Enables large file support.  This is not enabled by default, even on
297 platforms that support it, because it changes the format of INN's on-disk
298 databases (making it difficult to upgrade an earlier INN installation) and
299 can significantly increase the size of some of the history database files.
300 Large file support is not necessary unless your history database is so
301 large that it exceeds 2 GB or you want to use CNFS buffers larger than 2
302 GB.
303
304 The history, tradindexed and buffindexed overview, CNFS, and timecaf
305 databases written by an INN built with this option are incompatible with
306 those written by an INN without this option.
307
308 =item B<--enable-tagged-hash>
309
310 Use tagged hash table for the history database.  The tagged hash format
311 uses much less memory but is somewhat slower.  This option is recommended
312 if you have less than 256 MB of RAM on your news server.  If you install
313 INN without tagged hash (the default) and expire takes an excessive amount
314 of time, you should make sure the RAM in your system satisfies the
315 following formula:
316
317     ram > 10 * tablesize
318
319           ram:  Amount of system RAM (in bytes)
320     tablesize:  3rd field on the 1st line of history.dir (bytes)
321
322 If you don't have at least that much RAM, try rebuilding INN with tagged
323 hash enabled.
324
325 NOTE: B<--enable-largefiles> cannot be used with B<--enable-tagged-hash>.
326
327 =item B<--with-perl>
328
329 Enables support for embedded Perl, allowing you to install filter scripts
330 written in Perl.  Highly recommended, because many really good spam
331 filters are written in Perl.  See F<doc/hook-perl> for all the details.
332
333 Even if you do not use this option, INN still requires Perl as mentioned
334 above.
335
336 =item B<--with-python>
337
338 Enables support for Python, allowing you to install filter and
339 authentication scripts written in Python.  You will need Python 1.5.2 or
340 later installed on your system to enable this option.  See
341 F<doc/hook-python> for all the details.  Note that there is an
342 incompatibility between INN and Python 2.0 when Python is compiled with
343 cycle garbage collection; this problem was reported fixed in Python 2.1a1.
344
345 =item B<--with-innd-port>=PORT
346
347 By default, inndstart(8) refuses to bind to any port under 1024 other than
348 119 and 433 for security reasons (to prevent attacks on rsh(1)-based
349 commands and replacing standard system daemons).  If you want to run innd
350 on a different port under 1024, you'll need to tell configure what port
351 you intend to use.  (You'll also still need to set the port number in
352 F<inn.conf> or give it to inndstart on the command line.)
353
354 =item B<--with-syslog-facility>=FACILITY
355
356 Specifies the syslog facility that INN programs should log to.  The
357 default is LOG_NEWS unless configure detects that your system doesn't
358 understand that facility, in which case it uses LOG_LOCAL1.  This flag
359 overrides the automatic detection.  Be sure to specify a facility not used
360 by anything else on your system (one of LOG_LOCAL0 through LOG_LOCAL7, for
361 example).
362
363 =item B<--enable-libtool>
364
365 INN has optional support for libtool to generate shared versions of INN's
366 libraries.  This can significantly decrease the size of the various
367 binaries that come with a complete INN installation.  You can also choose
368 to use libtool even when only building static libraries; a libtool build
369 may be somewhat more portable on weird systems.  libtool builds aren't the
370 default because they take somewhat longer.  See C<./configure --help> for
371 the various available options related to libtool builds.
372
373 Please note that INN's shared library interface is not stable and may
374 change drastically in future releases.  For this reason, it's also not
375 properly versioned and won't be until some degree of stability is
376 guaranteed, and the relevant header files are not installed.  Only INN
377 should use INN's shared libraries, and you should only use the shared
378 libraries corresponding to the version of INN that you're installing.
379
380 Also, when updating an existing version of INN, INN tries to save backup
381 copies of all files so that you can revert to the previous installed
382 version.  Unfortunately, when using shared libraries, this confuses
383 ldconfig on some systems (such as Linux) and the symbolic links for the
384 libraries may point to the .OLD versions.  If this happens, you can either
385 fix the links by hand or remove the .OLD versions and re-run ldconfig.
386
387 =item B<--enable-uucp-rnews>
388
389 If this option is given to configure, rnews will be installed setuid news,
390 owned by group uucp, and mode 4550.  This will allow the UUCP subsystem
391 to run rnews to process UUCP batches of news articles.  Prior to INN 2.3,
392 installing rnews setuid news was standard; since most sites no longer use
393 UUCP, it is no longer the default as of INN 2.3 and must be requested at
394 configure time.  You probably don't want to use this option unless your
395 server accepts UUCP news batches.
396
397 =item B<--enable-setgid-inews>
398
399 If this option is given to configure, inews will be installed setgid news
400 and world-executable so that non-privileged users on the news server
401 machine can use inews to post articles locally (somewhat faster than
402 opening a new network connection).  For standalone news servers, by far
403 the most common configuration now, there's no need to use this option;
404 even if you have regular login accounts on your news server, INN's inews
405 can post fine via a network connection to your running news server and
406 doesn't need to use the local socket (which is what setgid enables it to
407 do).  Installing inews setgid was the default prior to INN 2.3.
408
409 =item B<--with-berkeleydb=PATH>
410
411 Enables support for Berkeley DB (2.x or 3.x), which means that it will
412 then be possible to use the ovdb overview method if you wish.  Enabling
413 this configure option doesn't mean you'll be required to use ovdb, but it
414 does require that Berkeley DB be installed on your system (including the
415 header files, not just the runtime libraries).  If a path is given, it
416 sets the installed directory of Berkeley DB (configure will search for it
417 in some standard locations, but if you have it installed elsewhere, you
418 may need this option).
419
420 =item B<--with-openssl=PATH>
421
422 Enables support for SSL for news reading, which means it will be possible
423 to have SSL or TLS encrypted NNTP connections between your server and
424 newsreaders.  This option requires OpenSSL be installed on your system
425 (including the header files, not just the runtime libraries).  If a path
426 is given, it sets the installed directory of OpenSSL.  After compiling and
427 installing INN with this option, you'll still need to make a certificate
428 and private key to use SSL.  See below for details on how to do that.
429
430 =item B<--enable-ipv6>
431
432 Enables support for IPv6 in innd, innfeed, nnrpd, and several of the
433 supporting programs.  This option should be considered developmental at
434 present.  For more information see F<doc/IPv6-info> (and if you have any
435 particularly good or bad news to report, please let us know at
436 <inn-bugs@isc.org>).
437
438 =back
439
440 For the most common installation, a standalone news server, a suggested
441 set of options is:
442
443     ./configure --with-perl
444
445 provided that you have the necessary version of Perl installed.
446 (Compiling with an embedded Perl interpretor will allow you to use one of
447 the available excellent spam filters if you so choose.)
448
449 If the configure program runs successfully, then you are ready to build
450 the distribution.  From the root of the INN source tree, type:
451
452     make
453
454 At this point you can step away from the computer for a little while and
455 have a quick snack while INN compiles.  On a decently fast system it
456 should only take five or ten minutes at the most to build.
457
458 Once the build has completed successfully, you are ready to install INN
459 into its final home.  Type:
460
461     make install
462
463 You will need to run this command as root so that INN can create the
464 directories it needs, change ownerships (if you did not compile as the
465 news user) and install a couple of setuid wrapper programs needed to raise
466 resource limits and allow innd to bind to ports under 1024.  This step
467 will install INN under the install directory (F</usr/local/news>, unless
468 you specified something else to the configure script).
469
470 If you are configuring SSL support for newsreaders, you must make a
471 certificate and private key at least once.  Type:
472
473     make cert
474
475 as root in order to do this.
476
477 You are now ready for the really fun part:  configuring your copy of INN!
478
479 =head1 Choosing an Article Storage Format
480
481 The first thing to decide is how INN should store articles on your system.
482 There are four different methods for you to choose from, each of which has
483 its own advantages and disadvantages.  INN can support all four at the
484 same time, so you can store certain newsgroups in one method and other
485 newsgroups in another method.
486
487 The supported storage formats are:
488
489 =over 4
490
491 =item tradspool
492
493 This is the storage method used by all versions of INN previous to 2.0.
494 Articles are stored as individual text files whose names are the same as
495 the article number.  The articles are divided up into directories based on
496 the newsgroup name.  For example, article 12345 in news.software.nntp
497 would be stored as F<news/software/nntp/12345> relative to the root of the
498 article spool.
499
500 Advantages:  Widely used and well-understood storage mechanism, can read
501 article spools written by older versions of INN, compatible with all
502 third-party INN add-ons, provides easy and direct access to the articles
503 stored on your server and makes writing programs that fiddle with the news
504 spool very easy, and gives you fine control over article retention times.
505
506 Disadvantages:  Takes a very fast file system and I/O system to keep up
507 with current Usenet traffic volumes due to file system overhead.  Groups
508 with heavy traffic tend to create a bottleneck because of inefficiencies
509 in storing large numbers of article files in a single directory.  Requires
510 a nightly expire program to delete old articles out of the news spool, a
511 process that can slow down the server for several hours or more.
512
513 =item timehash
514
515 Articles are stored as individual files as in tradspool, but are divided
516 into directories based on the arrival time to ensure that no single
517 directory contains so many files as to cause a bottleneck.
518
519 Advantages:  Heavy traffic groups do not cause bottlenecks, and fine
520 control of article retention time is still possible.
521
522 Disadvantages:  The ability to easily find all articles in a given
523 newsgroup and manually fiddle with the article spool is lost, and INN
524 still suffers from speed degredation due to file system overhead (creating
525 and deleting individual files is a slow operation).
526
527 =item timecaf
528
529 Similar to timehash, articles are stored by arrival time, but instead of
530 writing a separate file for each article, multiple articles are put in the
531 same file.
532
533 Advantages:  Roughly four times faster than timehash for article writes,
534 since much of the file system overhead is bypassed, while still retaining
535 the same fine control over article retention time.
536
537 Disadvantages:  Even worse than timehash, and similar to cnfs (below),
538 using this method means giving up all but the most careful manually
539 fiddling with your article spool.  As one of the newer and least widely
540 used storage types, timecaf has not been as thoroughly tested as the other
541 methods.
542
543 =item cnfs
544
545 CNFS stores articles sequentially in pre-configured buffer files.  When
546 the end of the buffer is reached, new articles are stored from the
547 beginning of the buffer, overwriting older articles.
548
549 Advantages:  Blazingly fast because no file creations or deletions are
550 necessary to store an article.  Unlike all other storage methods, does not
551 require manual article expiration; old articles are deleted to make room
552 for new ones when the buffers get too full.  Also, with CNFS your server
553 will never throttle itself due to a full spool disk, and groups are
554 restricted to just the buffer files you give them so that they can never
555 use more than the amount of disk space you allocate to them.
556
557 Disadvantages:  Article retention times are more difficult to control
558 because old articles are overwritten automatically.  Attacks on Usenet,
559 such as flooding or massive amounts of spam, can result in wanted articles
560 expiring much faster than you intended (with no warning).
561
562 =back
563
564 Some general recommendations:  If you are installing a transit news server
565 (one that just accepts news and sends it out again to other servers and
566 doesn't support any readers), use CNFS exclusively and don't worry about
567 any of the other storage methods.  Otherwise, put high-volume groups and
568 groups whose articles you don't need to keep around very long (binaries
569 groups, *.jobs*, news.lists.filters, etc.) in CNFS buffers, and use
570 timehash, timecaf, or tradspool (if you have a fast I/O subsystem or need
571 to be able to go through the spool manually) for everything else.  You'll
572 probably find it most convenient to keep special hierarchies like local
573 hierarchies and hierarchies that should never expire in tradspool.
574
575 If your news server will be supporting readers, you'll also need to choose
576 an overview storage mechanism (by setting I<ovmethod> in F<inn.conf>).
577 There are three overview mechanisms to choose from:  tradindexed,
578 buffindexed, and ovdb.  tradindexed is very fast for readers, but it has
579 to update two files for each incoming article and can be quite slow to
580 write.  buffindexed can keep up with a large feed more easily, since it
581 uses large buffers to store all overview information, but it's somewhat
582 slower for readers (although not as slow as the unified overview in INN
583 2.2).  ovdb stores overview data in a Berkeley DB database; it's fast and
584 very robust, but requires more disk space.  See the ovdb(5) man page for
585 more information on it.
586
587 Note that ovdb has not been as widely tested as the other overview
588 mechanisms and should be considered experimental.  tradindexed is the best
589 tested and most widely used of the overview implementations.
590
591 If buffindexed is chosen, you will need to create the buffers for it to
592 use (very similar to creating CNFS buffers) and list the available buffers
593 in F<buffindexed.conf>.  See buffindexed.conf(5) for more information.
594
595 =head1 Configuring INN
596
597 All documentation from this point on assumes that you have set up the news
598 user on your system as suggested in L<Installing INN> so that the root of
599 your INN installation is F<~news/>.  If you've moved things around by
600 using options with C<configure>, you'll need to adjust the instructions to
601 account for that.
602
603 All of INN's configuration files are located in F<~news/etc>.  Unless
604 noted otherwise, any files referred to below are in this directory.  When
605 you first install INN, a sample of each file (containing lots of comments)
606 is installed in F<~news/etc>; refer to these for concrete examples of
607 everything discussed in this section.
608
609 All of INN's configuration files, all of the programs that come with it,
610 and some of its library routines have documentation in the form of man
611 pages.  These man pages were installed in F<~news/man> as part of the INN
612 installation process and are the most complete reference to how INN works.
613 You're strongly encouraged to refer to the man pages frequently while
614 configuring INN, and for quick reference afterwards.  Any detailed
615 questions about individual configuration files or the behavior of specific
616 programs should be answered in them.  You may want to add F<~news/man> to
617 your MANPATH environment variable; otherwise, you may have to use a
618 command like:
619
620     man -M ~news/man inn.conf
621
622 to see the inn.conf(5) man page (for example).
623
624 Before we begin, it is worth mentioning the wildmat pattern matching
625 syntax used in many configuration files.  These are simple wildcard
626 matches using the asterisk (C<*>) as the wildcard character, much like the
627 simple wildcard expansion used by Unix shells.
628
629 In many cases, wildmat patterns can be specified in a comma-separated list
630 to indicate a list of newsgroups.  When used in this fashion, each pattern
631 is checked in turn to see if it matches, and the last pattern in the line
632 that matches the group name is used.  Patterns beginning with C<!> mean to
633 exclude groups matching that pattern.  For example:
634
635     *, !comp.*, comp.os.*
636
637 In this case, we're saying we match everything (C<*>), except that we
638 don't match anything under comp (C<!comp.*>), unless it is actually under
639 the comp.os hierarchy (C<comp.os.*>).  This is because non-comp groups
640 will match only the first pattern (so we want them), comp.os groups will
641 match all three patterns (so we want them too, because the third pattern
642 counts in this case), and all other comp groups will match the first and
643 second patterns and will be excluded by the second pattern.
644
645 Some uses of wildmat patterns also support "poison" patterns (patterns
646 starting with C<@>).  These patterns behave just like C<!> patterns when
647 checked against a single newsgroup name.  Where they become special is for
648 articles crossposted to multiple newsgroups; normally, such an article
649 will be considered to match a pattern if any of the newsgroups it is
650 posted to matches the pattern.  If any newsgroup the article is posted to
651 matches an expression beginning with C<@>, however, that article will not
652 match the pattern even if other newsgroups to which it was posted match
653 other expressions.
654
655 See uwildmat(3) for full details on wildmat patterns.
656
657 In all INN configuration files, blank lines and lines beginning with a
658 C<#> symbol are considered comments and are ignored.  Be careful, not all
659 files permit comments to begin in the middle of the line.
660
661 =head2 inn.conf
662
663 The first, and most important file is F<inn.conf>.  This file is organized
664 as a series of parameter-value pairs, one per line.  The parameter is
665 first, followed by a colon and one or more whitespace characters, and then
666 the value itself.  For some parameters the value is a string or a number;
667 for others it is true or false.  (True values can be written as C<yes>,
668 C<true>, or C<on>, whichever you prefer.  Similarly, false values can be
669 written as C<no>, C<false>, or C<off>.)
670
671 F<inn.conf> contains dozens of changeable parameters (see inn.conf(5) for
672 full details), but only a few really need to be edited during normal
673 operation:
674
675 =over 4
676
677 =item allownewnews
678
679 If set to true then INN will support the NEWNEWS command for news readers.
680 While this can be an expensive operation, its speed has been improved
681 considerably as of INN 2.3 and it's probably safe to turn on without
682 risking excessive server load.  The default is true.  (Note that the
683 I<access:> setting in F<readers.conf> overrides this value; see
684 readers.conf(5) for more details.)
685
686 =item complaints
687
688 Used to set the value of the X-Complaints-To: header, which is added to
689 all articles posted locally.  The usual value would be something like
690 C<abuse@example.com> or C<postmaster@example.com>.  If not specified, the
691 newsmaster email address will be used.
692
693 =item hiscachesize
694
695 The amount of memory (in kilobytes) to allocate for a cache of recently
696 used history file entries.  Setting this to 0 disables history caching.
697 History caching can greatly increase the number of articles per second
698 that your server is capable of processing.  A value of C<256> is a good
699 default choice.
700
701 =item logipaddr
702
703 If set to true (the default), INN will log the IP address (or hostname, if
704 the host is listed in F<incoming.conf> with a hostname) of the remote host
705 from which it received an article.  If set to false, the trailing Path:
706 header entry is logged instead.  If you are using controlchan (see below)
707 and need to process ihave/sendme control messages (this is very, very
708 unlikely, so if you don't know what this means, don't worry about it),
709 make sure you set this to false, since controlchan needs a site name, not
710 an IP address.
711
712 =item organization
713
714 Set this to the name of your organization as you want it to appear in the
715 Organization: header of all articles posted locally and not already
716 containing that header.  This will be overridden by the value of the
717 ORGANIZATION environment variable (if it exists).  If neither this
718 parameter nor the environment variable or set, no Organization: header
719 will be added to posts which lack one.
720
721 =item pathhost
722
723 This is the name of your news server as you wish it to appear in the Path:
724 header of all postings which travel through your server (this includes
725 local posts and incoming posts that you forward out to other sites).  If
726 this parameter is unspecified, the fully-qualified domain name (FQDN) of
727 the machine will be used instead.  Please use the FQDN of your server or
728 an alias for your server unless you have a very good reason not to; a
729 future version of the news RFCs may require this.
730
731 =item rlimitnofile
732
733 If set to a non-negative value (the default is C<-1>), INN (both innd and
734 innfeed) will try to raise the maximum number of open file descriptors to
735 this value when it starts.  This may be needed if you have lots of
736 incoming and outgoing feeds.  Note that the maximum value for this setting
737 is very operating-system-dependent, and you may have to reconfigure your
738 system (possibly even recompile your kernel) to increase it.  See L<File
739 Descriptor Limits> for complete details.
740
741 =back
742
743 There are tons of other possible settings; you may want to read through
744 inn.conf(5) to get a feel for your options.  Don't worry if you don't
745 understand the purpose of most of them right now.  Some of the settings
746 are only needed for very obscure things, and with more experience running
747 your news server the rest will make more sense.
748
749 =head2 newsfeeds
750
751 F<newsfeeds> determines how incoming articles are redistributed to your
752 peers and to other INN processes.  F<newsfeeds> is very versatile and
753 contains dozens of options; we will touch on just the basics here.
754 The manpage contains more detailed information.
755
756 F<newsfeeds> is organized as a series of feed entries.  Each feed entry is
757 composed of four fields separated by colons.  Entries may span multiple
758 lines by using a backslash (C<\>) to indicate that the next line is a
759 continuation of the current line.  (Note that comments don't interact with
760 backslashes in the way you might expect.  A commented-out line ending in a
761 backslash will still be considered continued on the next line, possibly
762 resulting in more commented out than you intended or bizarre syntax
763 errors.  In general, it's best to avoid commenting out lines in the middle
764 of continuation lines.)
765
766 The first field in an entry is the name of the feed.  It must be unique,
767 and for feeds to other news servers it is usually set to the actual
768 hostname of the remote server (this makes things easier).  The name can
769 optionally be followed by a slash and a comma-separated exclude list.  If
770 the feed name or any of the names in the exclude list appear in the Path
771 line of an article, then that article will not be forwarded to the feed as
772 it is assumed that it has passed through that site once already.  The
773 exclude list is useful when a news server's hostname is not the same as
774 what it puts in the Path header of its articles, or when you don't want a
775 feed to receive articles from a certain source.
776
777 The second field specifies a set of desired newsgroups and distribution
778 lists, given as newsgroup-pattern/distribution-list.  The distribution
779 list is not described here; see newsfeeds(5) for information (it's not
780 used that frequently in practice).  The newsgroup pattern is a
781 wildmat-style pattern list as described above (supporting C<@>).
782
783 The third field is a comma-separated list of flags that determine both the
784 type of feed entry and sets certain parameters for the entry.  See
785 newsfeeds(5) for information on the flag settings; you can do a surprising
786 amount with them.  The three most common patterns, and the ones mainly
787 used for outgoing news feeds to other sites, are C<Tf,Wnm> (to write out a
788 batch file of articles to be sent, suitable for processing by nntpsend and
789 innxmit), C<Tm> (to send the article to a funnel feed, used with innfeed),
790 and C<Tc,Wnm*> (to collect a funnel feed and send it via a channel feed to
791 an external program, used to send articles to innfeed).
792
793 The fourth field is a multi-purpose parameter whose meaning depends on the
794 settings of the flags in the third field.  To get a feel for it using the
795 examples above, for file feeds (C<Tf>) it's the name of the file to write,
796 for funnel feeds (C<Tm>) it's the name of the feed entry to funnel into,
797 and for channel feeds (C<Tc>) it's the name of the program to run and feed
798 references to articles.
799
800 Now that you have a rough idea of the file layout, we'll begin to add the
801 actual feed entries.  First, we'll set up the special ME entry.  This entry
802 is required and serves two purposes:  the newsgroup pattern specified here
803 is prepended to the newsgroup list of all other feeds, and the
804 distribution pattern for this entry determines what distributions (from
805 the Distribution: header of incoming articles) are accepted from remote
806 sites by your server.  The example in the sample newsfeeds file is a good
807 starting point.  If you are going to create a local hierarchy that should
808 not be distributed off of your system, it may be useful to exclude it from
809 the default subscription pattern, but default subscription patterns are
810 somewhat difficult to use right so you may want to just exclude it
811 specifically from every feed instead.
812
813 The ME entry tends to confuse a lot of people, so this point is worth
814 repeating:  the newsgroup patterns set the default subscription for
815 I<outgoing> feeds, and the distribution patterns set the acceptable
816 Distribution: header entries for I<incoming> articles.  This is confusing
817 enough that it may change in later versions of INN.
818
819 There are two basic ways to feed articles to remote sites.  The most
820 common for large sites and particularly for transit news servers is
821 innfeed(8), which sends articles to remote sites in real time (the article
822 goes out to all peers that are supposed to receive it immediately after
823 your server accepts it).  For smaller sites, particularly sites where the
824 only outgoing messages will be locally posted articles, it's more common
825 to batch outgoing articles and send them every ten minutes or so from cron
826 using nntpsend(8) and innxmit(8).  Batching gives you more control and
827 tends to be extremely stable and reliable, but it's much slower and can't
828 handle high volume very well.
829
830 Batching outgoing posts is easy to set up; for each peer, add an entry to
831 newsfeeds that looks like:
832
833     remote.example.com/news.example.com\
834         :<newsgroups>\
835         :Tf,Wnm:
836
837 where <newsgroups> is the wildmat pattern for the newsgroups that site
838 wants.  In this example, the actual name of the remote site is
839 "remote.example.com", but it puts "news.example.com" in the Path: header.
840 If the remote site puts its actual hostname in the Path: header, you won't
841 need the C</news.example.com> part.
842
843 This entry will cause innd to write out a file in F<~news/spool/outgoing>
844 named F<remote.example.com> and containing the Message-ID and storage
845 token of each message to send to that site.  (The storage token is INN's
846 internal pointer to where an article is stored; to retrieve an article
847 given its storage token, use sm(8)).  F<innxmit> knows how to read files
848 of this format and send those articles to the remote site.  For
849 information on setting it up to run periodically, see L<Setting Up the
850 Cron Jobs> below.  You will also need to set up a config file for
851 F<nntpsend>; see the man page for nntpsend.ctl(5) for more information.
852
853 If instead you want to use F<innfeed> to send outgoing messages
854 (recommended for sites with more than a couple of peers), you need some
855 slightly more complex magic.  You still set up a separate entry for each
856 of your peers, but rather than writing out batch files, they all "funnel"
857 into a special innfeed entry.  That special entry collects all of the
858 separate funnel feeds and sends the data through a special sort of feed to
859 an external program (F<innfeed> in this case); this is a "channel" feed.
860
861 First, the special channel feed entry for F<innfeed> that will collect all
862 the funnel feeds:
863
864     innfeed!\
865         :!*\
866         :Tc,Wnm*:/usr/local/news/bin/startinnfeed -y
867
868 (adjust the path to startinnfeed(1) if you installed it elsewhere).  Note
869 that we don't feed this entry any articles directly (its newsgroup pattern
870 is C<!*>).  Note also that the name of this entry ends in an exclamation
871 point.  This is a standard convention for all special feeds; since the
872 delimiter for the Path: header is C<!>, no site name containing that
873 character can ever match the name of a real site.
874
875 Next, set up entries for each remote site to which you will be feeding
876 articles.  All of these entries should be of the form:
877
878     remote.example.com/news.example.com\
879         :<newsgroups>\
880         :Tm:innfeed!
881
882 specifying that they funnel into the C<innfeed!> feed.  As in the previous
883 example for batching, "remote.example.com" is the actual name of the
884 remote peer, "news.example.com" is what it puts in the Path: header (if
885 different than the actual name of the server), and <newsgroups> is the
886 wildmat pattern of newsgroups to be sent.
887
888 As an alternative to NNTP, INN may also feed news out to an IMAP server,
889 by using imapfeed(8), which is almost identical to F<innfeed>.  The
890 F<startinnfeed> process can be told to start F<imapfeed> instead of
891 F<innfeed>.  The feed entry for this is as follows:
892
893     imapfeed!\
894         :!*\
895         :Tc,Wnm*,S16384:/usr/local/news/bin/startinnfeed imapfeed
896
897 And set up entries for each remote site like:
898
899     remote.example.com/news.example.com\
900         :<newsgroups>\
901         :Tm:imapfeed!
902
903 For more information on F<imapfeed>, look at the
904 F<innfeed/imap_connection.c>.  For more information on IMAP in general,
905 see RFC 2060.
906
907 Finally, there is a special entry for controlchan(8), which processes
908 newsgroup control messages, that should always be in F<newsfeeds> unless
909 you never want to honor any control messages.  This entry should look
910 like:
911
912     controlchan!\
913         :!*,control,control.*,!control.cancel\
914         :Tc,Wnsm:/usr/local/news/bin/controlchan
915
916 (modified for the actual path to F<controlchan> if you put it somewhere
917 else).  See L<Processing Control Messages> for more details.
918
919 For those of you upgrading from earlier versions of INN, note that the
920 functionality of overchan(8) and F<crosspost> is now incorporated into INN
921 and neither of those programs is necessary.  Unfortunately, F<crosspost>
922 currently will not work even with the tradspool storage method.  You can
923 still use F<overchan> if you make sure to set I<useoverchan> to true in
924 F<inn.conf> so that innd doesn't write overview data itself, but be
925 careful:  innd may accept articles faster than overchan can process the
926 data.
927
928 =head2 incoming.conf
929
930 F<incoming.conf> file specifies which machines are permitted to connect to
931 your host and feed it articles.  Remote servers you peer with should be
932 listed here.  Connections from hosts not listed in this file will (if you
933 don't allow readers) be rejected or (if you allow readers) be handed off
934 to nnrpd and checked against the access restrictions in F<readers.conf>.
935
936 Start with the sample F<incoming.conf> and, for each remote peer, add an
937 entry like:
938
939     peer remote.example.com { }
940
941 This uses the default parameters for that feed and allows incoming
942 connections from a machine named "remote.example.com".  If that peer could
943 be connecting from several different machines, instead use an entry like:
944
945      peer remote.example.com {
946         hostname: "remote.example.com, news.example.com"
947      }
948
949 This will allow either "remote.example.com" or "news.example.com" to feed
950 articles to you.  (In general, you should add new peer lines for each
951 separate remote site you peer with, and list multiple host names using the
952 I<hostname> key if one particular remote site uses multiple servers.)
953
954 You can restrict the newsgroups a remote site is allowed to send you,
955 using the same sort of pattern that newsfeeds(5) uses.  For example, if
956 you want to prevent "example.com" hosts from sending you any articles in
957 the C<local.*> hierarchy (even if they're crossposted to other groups),
958 change the above to:
959
960     peer remote.example.com {
961         patterns: "*, @local.*"
962         hostname: "remote.example.com, news.example.com"
963     }
964
965 Note, however, that restricting what a remote side can send you will
966 I<not> reduce your incoming bandwidth usage.  The remote site will still
967 send you the entire article; INN will just reject it rather than saving it
968 to disk.  To reduce bandwidth, you have to contact your peers and ask them
969 not to send you the traffic you don't want.
970
971 There are various other things you can set, including the maximum number
972 of connections the remote host will be allowed.  See incoming.conf(5) for
973 all the details.
974
975 Note for those familiar with older versions of INN:  this file replaces
976 the old F<hosts.nntp> configuration file.
977
978 =head2 cycbuff.conf
979
980 F<cycbuff.conf> is only required if CNFS is used.  If you aren't using
981 CNFS, skip this section.
982
983 CNFS stores articles in logical objects called I<metacycbuffs>.  Each
984 metacycbuff is in turn composed of one or more physical buffers called
985 I<cycbuffs>.  As articles are written to the metacycbuff, each article is
986 written to the next cycbuff in the list in a round-robin fashion (unless
987 C<sequential> mode is specified, in which case each cycbuff is filled
988 before moving on to the next).  This is so that you can distribute the
989 individual cycbuffs across multiple physical disks and balance the load
990 between them.
991
992 There are two ways to create your cycbuffs:
993
994 =over 4
995
996 =item 1.
997
998 Use a block device directly.  This will probably give you the most speed
999 since it avoids the file system overhead of large files, but it requires
1000 your OS support mmap(2) on a block device.  Solaris supports this, as do
1001 late Linux 2.4 kernels.  FreeBSD does not at last report.  Also on many
1002 PC-based Unixes it is difficult to create more than eight partitions,
1003 which may limit your options.
1004
1005 =item 2.
1006
1007 Use a real file on a filesystem.  This will probably be a bit slower than
1008 using a block device directly, but it should work on any Unix system.
1009
1010 =back
1011
1012 If you're having doubts, use option #2; it's easier to set up and should
1013 work regardless of your operating system.
1014
1015 Now you need to decide on the sizes of your cycbuffs and metacycbuffs.
1016 You'll probably want to separate the heavy-traffic groups
1017 (C<alt.binaries.*> and maybe a few other things like C<*.jobs*> and
1018 C<news.lists.filters>) into their own metacycbuff so that they don't
1019 overrun the server and push out articles on the more useful groups.  If
1020 you have any local groups that you want to stay around for a while then
1021 you should put them in their own metacycbuff as well, so that they don't
1022 get pushed out by other traffic.  (Or you might store them in one of the
1023 other storage methods, such as tradspool.)
1024    
1025 For each metacycbuff, you now need to determine how many cycbuffs will
1026 make up the metacycbuff, the size of those cycbuffs, and where they will
1027 be stored.  Some OSes do not support files larger than 2 GB, which will
1028 limit the size you can make a single cycbuff, but you can still combine
1029 many cycbuffs into each metacycbuff.  Older versions of Linux are known to
1030 have this limitation; FreeBSD does not.  Some OSes that support large
1031 files don't support direct access to block devices for large partitions
1032 (Solaris prior to Solaris 7, or not running in 64-bit mode, is in this
1033 category); on those OSes, if you want cycbuffs over 2 GB, you'll have to
1034 use regular files.  If in doubt, keep your cycbuffs smaller than 2 GB.
1035 Also, when laying out your cycbuffs, you will want to try to arrange them
1036 across as many physical disks as possible (or use a striped disk array and
1037 put them all on that).
1038
1039 In order to use any cycbuff larger than 2 GB, you need to build INN with
1040 the B<--enable-largefiles> option.  See L<Installing INN> for more
1041 information and some caveats.
1042
1043 For each cycbuff you will be creating, add a line to F<cycbuff.conf> like
1044 the following:
1045
1046     cycbuff:NAME:/path/to/buffer:SIZE
1047
1048 NAME must be unique and must be at most seven characters long.  Something
1049 simple like "BUFF00", "BUFF01", etc. is a decent choice, or you may want
1050 to use something that includes the SCSI target and slice number of the
1051 partition.  SIZE is the buffer size in kilobytes (if you're trying to stay
1052 under 2 GB, keep your sizes below C<2097152>).
1053
1054 Now, you need to tell INN how to group your cycbuffs into metacycbuffs.
1055 This is similar to creating cycbuff entries:
1056
1057     metacycbuff:BUFFNAME:CYCBUFF,CYCBUFF,CYCBUFF
1058
1059 BUFFNAME is the name of the metacycbuff and must be unique and at most
1060 eight characters long.  These should be a bit more meaningful than the
1061 cycbuff names since they will be used in other config files as well.  Try
1062 to name them after what will be stored in them; for example, if this
1063 metacycbuff will hold alt.binaries postings, "BINARIES" would be a good
1064 choice.  The last part of the entry is a comma-separated list of all of
1065 the cycbuffs that should be used to build this metacycbuff.  Each cycbuff
1066 should only appear in one metacycbuff line, and all metacycbuff lines must
1067 occur after all cycbuff lines in the file.
1068
1069 If you want INN to fill each cycbuff before moving on to the next one
1070 rather than writing to them round-robin, add C<:SEQUENTIAL> to the end of
1071 the metacycbuff line.  This may give noticeably better performance when
1072 using multiple cycbuffs on the same spindle (such as partitions or slices
1073 of a larger disk), but will probably give worse performance if your
1074 cycbuffs are spread out across a lot of spindles.
1075
1076 By default, CNFS data is flushed to disk every 25 articles.  If you're
1077 running a small server with a light article load, this could mean losing
1078 quite a few articles in a crash.  You can change this interval by adding a
1079 cycbuffupdate line to your F<cycbuff.conf> file; see cycbuff.conf(5) for
1080 more details.
1081
1082 Finally, you have to create the cycbuffs.  See L<Creating the Article
1083 Spool> for more information on how to do that.
1084
1085 =head2 storage.conf
1086
1087 F<storage.conf> determines where incoming articles will be stored (what
1088 storage method, and in the case of CNFS, what metacycbuff).  Each entry in
1089 the file defines a storage class for articles.  The first matching storage
1090 class is used to store the article; if no storage class matches, INN will
1091 reject that article.  (This is almost never what you want, so make sure
1092 this file ends in a catch-all entry that will match everything.)
1093
1094 A storage class definition looks like this:
1095
1096     method <methodname> {
1097         newsgroups: <wildmat>
1098         class: <storage_class>
1099         size: <minsize>[,<maxsize>]
1100         expires: <mintime>[,<maxtime>]
1101         options: <options>
1102     }
1103
1104 <methodname> is the name of the storage method to use to store articles in
1105 this class ("cnfs", "timehash", "timecaf", "tradspool", or the special
1106 method "trash" that accepts the article and throws it away).
1107
1108 The first parameter is a wildmat pattern in the same format used by the
1109 newsfeeds(5) file, and determines what newsgroups are accepted by this
1110 storage class.
1111
1112 The second parameter is a unique number identifying this storage class and
1113 should be between 0 and 255.  It can be used to control article
1114 expiration, and for timehash and timecaf will set the top-level directory
1115 in which articles accepted by this storage class are stored.  The easiest
1116 way to deal with this parameter is to just number all storage classes in
1117 F<storage.conf> sequentially.  The assignment of a particular number to a
1118 storage class is arbitrary but I<permanent> (since it is used in storage
1119 tokens).
1120
1121 The third parameter can be used to accept only articles in a certain size
1122 range into this storage class.  A <maxsize> of C<0> (or a missing
1123 <maxsize>) means no upper limit (and of course a <minsize> of C<0> would
1124 mean no lower limit, because all articles are more than zero bytes long).
1125 If you don't want to limit the size of articles accepted by this storage
1126 class, leave this parameter out entirely.
1127
1128 The fourth parameter you probably don't want to use; it lets you assign
1129 storage classes based on the Expires: header of incoming articles.  The
1130 exact details are in storage.conf(5).  It's very easy to use this
1131 parameter incorrectly; leave it out entirely unless you've read the man
1132 page and know what you're doing.
1133
1134 The fifth parameter is the options parameter.  Currently only CNFS uses
1135 this field; it should contain the name of the metacycbuff used to store
1136 articles in this storage class.
1137
1138 If you're using CNFS exclusively, just create one storage class for each
1139 metacycbuff that you have defined in F<cycbuff.conf> and set the
1140 newsgroups pattern according to what newsgroups should be stored in that
1141 buffer.
1142
1143 If you're using timehash or timecaf, the storage class IDs are used to
1144 store articles in separate directory trees, which you can take advantage
1145 of to put particular storage classes on different disks.  Also, currently
1146 storage class is the only way to specify expiration time, so you will need
1147 to divide up your newsgroups based on how long you want to retain articles
1148 in those groups and create a storage class for each such collection of
1149 newsgroups.  Make note of the storage class IDs you assign as they will be
1150 needed when you edit F<expire.ctl> a bit later.
1151
1152 =head2 expire.ctl
1153
1154 F<expire.ctl> sets the expiration policy for articles stored on the
1155 server.  Be careful, since the default configuration will expire most
1156 articles after 10 days; in most circumstances this deletion is
1157 I<permanent>, so read this whole section carefully if you want to keep
1158 local hierarchies forever.  (See archive(8) for a way to automate backups
1159 of important articles.)
1160
1161 Only one entry is required for all storage classes; it looks like:
1162
1163     /remember/:10
1164
1165 This entry says how long to keep the Message-IDs for articles that have
1166 already expired in the history file so that the server doesn't accept them
1167 again.  Occasionally, fairly old articles will get regurgitated somewhere
1168 and offered to you again, so even after you've expired articles from your
1169 spool, you want to keep them around in your history file for a little
1170 while to ensure you don't get duplicates.
1171
1172 INN will reject any articles more than a certain number of days old (the
1173 I<artcutoff> parameter in F<inn.conf>, defaulting to C<10>); the number on
1174 the C</remember/> line should match that.
1175
1176 CNFS makes no further use of F<expire.ctl>, since articles stored in CNFS
1177 buffers expire automatically when the buffer runs out of free space (but
1178 see the C<-N> option in expireover(8) if you really want to expire them
1179 earlier).  For other storage methods, there are two different syntaxes of
1180 this file, depending on I<groupbaseexpiry> in F<inn.conf>.  If it is set
1181 to false, F<expire.ctl> takes entries of the form:
1182
1183     <storage_class>:<keep>:<default>:<purge>
1184
1185 <storage_class> is the number assigned to a storage class in
1186 F<storage.conf>.  <default> is the number of days to keep normal articles
1187 in that storage class (decimal values are allowed).  For articles that
1188 don't have an Expires: header, those are the only two values that matter.
1189 For articles with an Expires: header, the other two values come into play;
1190 the date given in the Expires: header of an article will be honored,
1191 subject to the contraints set by <keep> and <purge>.  All articles in this
1192 storage class will be kept for at least <keep> days, regardless of their
1193 Expires: headers, and all articles in this storage class will be expired
1194 after <purge> days, even if their Expires: headers specify a longer life.
1195
1196 All three of these fields can also contain the special keyword C<never>.
1197 If <default> is C<never>, only articles with explicit Expires: headers
1198 will ever be expired.  If <keep> is C<never>, articles with explicit
1199 Expires: headers will be kept forever.  Setting <purge> to C<never> says
1200 to honor Expires: headers even if they specify dates far into the future.
1201 (Note that if <keep> is set to C<never>, all articles with Expires:
1202 headers are kept forever and the value of <purge> is not used.)
1203
1204 If the value of C<groupbaseexpiry> is true, F<expire.ctl> takes entries of
1205 the form:
1206
1207     <wildmat>:<flag>:<keep>:<default>:<purge>
1208
1209 <wildmat> is a wildmat expression (C<!> and C<@> not permitted, and only a
1210 single expression, not a comma-separated set of them).  Each expiration
1211 line applies to groups matching the wildmat expression.  <flag> is C<M>
1212 for moderated groups, C<U> for unmoderated groups, and C<A> for groups
1213 with any moderation status; the line only matches groups with the
1214 indicated expiration status.  All of the other fields have the same
1215 meaning as above.
1216
1217 =head2 readers.conf
1218
1219 Provided that I<noreader> is set to false in F<inn.conf>, any connection
1220 from a host that doesn't match an entry in F<incoming.conf> (as well as
1221 any connection from a host that does match such an entry, but has issued a
1222 MODE READER command) will be handed off to nnrpd(8), the part of INN that
1223 supports newsreading clients.  nnrpd uses F<readers.conf> to determine
1224 whether a given connection is allowed to read news, and if so what
1225 newsgroups the client can read and post to.
1226
1227 There are a variety of fairly complicated things that one can do with
1228 F<readers.conf>, things like run external authentication programs that can
1229 query RADIUS servers.  See readers.conf(5) and the example file for all
1230 the gory details.  Here's an example of probably the simplest reasonable
1231 configuration, one that only allows clients in the example.com domain to
1232 read from the server and allows any host in that domain to read and post
1233 to all groups:
1234
1235     auth "example.com" {
1236         hosts: "example.com, *.example.com"
1237         default: "<user>"
1238         default-domain: "example.com"
1239     }
1240
1241     access "all" {
1242         users: "*@example.com"
1243         newsgroups: "*"
1244     }
1245
1246 If you're running a server for one particular domain, want to allow all
1247 hosts within that domain to read and post to any group on the server, and
1248 want to deny access to anyone outside that domain, just use the above and
1249 change C<example.com> in the above to your domain and you're all set.
1250 Lots of examples of more complicated things are in the sample file.
1251
1252 =head1 Creating the Article Spool (CNFS only)
1253
1254 If you are using actual files as your CNFS buffers, you will need to
1255 pre-create those files, ensuring they're the right size.  The easiest way
1256 to do this is with dd.  For each cycbuff in F<cycbuff.conf>, create the
1257 buffer with the following commands (as the news user):
1258
1259     dd if=/dev/zero of=/path/to/buffer bs=1k count=BUFFERSIZE
1260     chmod 664 /path/to/buffer
1261
1262 Substitute the correct path to the buffer and the size of the buffer as
1263 specified in F<cycbuff.conf>.  This will create a zero-filled file of the
1264 correct size; it may take a while, so be prepared to wait.
1265
1266 Here's a command that will print out the dd(1) commands that you should
1267 run:
1268
1269     awk -F: \
1270     '/^cy/ { printf "dd if=/dev/zero of=%s bs=1k count=%s\n", $3, $4 }' \
1271     ~news/etc/cycbuff.conf
1272
1273 If you are using block devices, you don't technically have to do anything
1274 at all (since INN is capable of using the devices in F</dev>), but you
1275 probably want to create special device files for those devices somewhere
1276 for INN's private use.  It s more convenient to keep all of INN's stuff
1277 together, but more importantly, the device files used by INN really should
1278 be owned by the news user and group, and you may not want to do that with
1279 the files in F</dev>.
1280
1281 To create the device files for INN, use mknod(8) with a type of C<b>,
1282 getting the major and minor device numbers from the existing devices in
1283 F</dev>.  There's a small shell script in cycbuff.conf(5) that may help
1284 with this.  Make sure to create the device files in the location INN
1285 expects them (specified in F<cycbuff.conf>).
1286
1287 Solaris users please note:  on Solaris, do not use block devices that
1288 include the first cylinder of the disk.  Solaris doesn't protect the
1289 superblock from being overwritten by an application writing to block
1290 devices and includes it in the first cylinder of the disk, so unless you
1291 use a slice that starts with cylinder 1 instead of 0, INN will invalidate
1292 the partition table when it tries to initialize the cycbuff and all
1293 further accesses will fail until you repartition.
1294
1295 =head1 Creating the Database Files
1296
1297 At this point, you need to set up the news database directory
1298 (F<~news/db>).  This directory will hold the active(5) file (the list of
1299 newsgroups you carry), the active.times(5) file (the creator and creation
1300 time of newsgroups created since the server was initialized), the
1301 newsgroups(5) file (descriptions for all the newsgroups you carry), and
1302 the history(5) file (a record of every article the server currently has or
1303 has seen in the past few days, used to decide whether to accept or refuse
1304 new incoming messages).
1305
1306 Before starting to work on this, make sure you're logged on as the news
1307 user, since all of these files need to be owned by that user.  This is a
1308 good policy to always follow; if you are doing any maintenance work on
1309 your news server, log on as the news user.  Don't do maintenance work as
1310 root.  Also make sure that F<~news/bin> is in the default path of the news
1311 user (and while you're at it, make sure F<~news/man> is in the default
1312 MANPATH) so that you can run INN maintenance commands without having to
1313 type the full path.
1314
1315 If you already have a server set up (if you're upgrading, or setting up a
1316 new server based on an existing server), copy F<active> and F<newsgroups>
1317 from that server into F<~news/db>.  Otherwise, you'll need to figure out
1318 what newsgroups you want to carry and create new active and newsgroups
1319 files for them.  If you plan to carry a full feed, or something close to
1320 that, go to <ftp://ftp.isc.org/pub/usenet/CONFIG/> and download F<active>
1321 and F<newsgroups> from there; that will start you off with reasonably
1322 complete files.  If you plan to only carry a small set of groups, the
1323 default minimal F<active> file installed by INN is a good place to start;
1324 you can create additional groups after the server is running by using
1325 C<ctlinnd newgroup>.  (Another option is to use actsync(8) to synchronize
1326 your newsgroup list to that of another server.)
1327
1328 C<control> and C<junk> must exist as newsgroups in your active file for
1329 INN to start, and creating pseudogroups for the major types of control
1330 messages is strongly encouraged for all servers that aren't standalone.
1331 If you don't want these groups to be visible to clients, do I<not> delete
1332 them; simply hide them in F<readers.conf>.  C<to> must also exist as a
1333 newsgroup if you have mergetogroups set in F<inn.conf>.
1334
1335 Next, you need to create an empty history database.  To do this, type:
1336
1337     cd ~news/db
1338     touch history
1339     makedbz -i
1340
1341 When it finishes, rename the files it created to remove the C<.n> in the
1342 file names and then make sure the file permissions are correct on all the
1343 files you've just created:
1344
1345     chmod 644 *
1346
1347 Your news database files are now ready to go.
1348
1349 =head1 Configuring syslog
1350
1351 While some logs are handled internally, INN also logs a wide variety of
1352 information via syslog.  INN's nightly report programs know how to roll
1353 and summarize those syslog log files, but when you first install INN you
1354 need to set them up.
1355
1356 If your system understands the C<news> syslog facility, INN will use it;
1357 otherwise, it will log to C<local1>.  Nearly every modern system has a
1358 C<news> syslog facility so you can safely assume that yours does, but if
1359 in doubt take a look at the output from running C<configure>.  You should
1360 see a line that looks like:
1361
1362     checking log level for news... LOG_NEWS
1363
1364 If that says LOG_LOCAL1 instead, change the below instructions to use
1365 C<local1> instead of C<news>.
1366
1367 Edit F</etc/syslog.conf> on your system and add lines that look like the
1368 following:
1369
1370     news.crit           /usr/local/news/log/news.crit
1371     news.err            /usr/local/news/log/news.err
1372     news.notice         /usr/local/news/log/news.notice
1373
1374 (Change the path names as necessary if you installed INN in a different
1375 location than F</usr/local/news>.)  These lines I<must> be tab-delimited,
1376 so don't copy and paste from these instructions.  Type it in by hand and
1377 make sure you use a tab, or you'll get mysterious failures.  You'll also
1378 want to make sure that news log messages don't fill your other log files
1379 (INN generates a lot of log traffic); so for every entry in
1380 F</etc/syslog.conf> that starts with C<*>, add C<;news.none> to the end of
1381 the first column.  For example, if you have a line like:
1382
1383     *.err               /dev/console
1384
1385 change it to:
1386
1387     *.err;news.none     /dev/console
1388
1389 (You can choose not to do this for the higher priority log messages, if
1390 you want to make sure they go to your normal high-priority log files as
1391 well as INN's.  Don't bother with anything lower priority than C<crit>,
1392 though.  C<news.err> isn't interesting enough to want to see all the
1393 time.)  Now, make sure that the news log files exist; syslog generally
1394 won't create files automatically.  Enter the following commands:
1395
1396     touch /usr/local/news/log/news.crit
1397     touch /usr/local/news/log/news.err
1398     touch /usr/local/news/log/news.notice
1399     chown news /usr/local/news/log/news.*
1400     chgrp news /usr/local/news/log/news.*
1401
1402 (again adjusting the paths if necessary for your installation).  Finally,
1403 send a HUP signal to syslogd to make it re-read its configuration file.
1404
1405 =head1 Setting Up the Cron Jobs
1406
1407 INN requires a special cron job to be set up on your system to run
1408 news.daily(8) which performs daily server maintenance tasks such as
1409 article expiration and the processing and rotation of the server logs.
1410 Since it will slow the server down while it is running, it should be run
1411 during periods of low server usage, such as in the middle of the night.
1412 To run it at 3am, for example, add the following entry to the news user's
1413 crontab file:
1414
1415     0 3 * * * /usr/local/news/bin/news.daily expireover lowmark
1416
1417 or, if your system does not have per-user crontabs, put the following line
1418 into your system crontab instead:
1419
1420     0 3 * * * su -c "/usr/local/news/bin/news.daily expireover lowmark" news
1421
1422 If you're using any non-CNFS storage methods, add C<delayrm> to the above
1423 option list for news.daily.
1424
1425 The news user obviously must be able to run cron jobs.  On Solaris, this
1426 means that it must have a valid F</etc/shadow> entry and must not be
1427 locked (although it may be a non-login account).  There may be similar
1428 restrictions with other operating systems.
1429
1430 If you use the batching method to send news, also set up a cron job to run
1431 nntpsend(8) every ten minutes.  nntpsend will run innxmit for all
1432 non-empty pending batch files to send pending news to your peers.  That
1433 cron entry should look something like:
1434
1435     0,10,20,30,40,50 * * * * /usr/local/news/bin/nntpsend
1436
1437 The pathnames and user ID used above are the installation defaults; change
1438 them to match your installation if you used something other than the
1439 defaults.
1440
1441 The parameters passed to news.daily in the above example are the most
1442 common (and usually the most efficient) ones to use.  More information on
1443 what these parameters do can be found in the news.daily(8) man page.
1444
1445 =head1 File Descriptor Limits
1446
1447 INN likes to use a lot of file descriptors, particularly if you have a lot
1448 of peers.  Depending on what your system defaults are, you may need to
1449 make sure the default limit is increased for INN (particularly for innd
1450 and innfeed).  This is vital on Solaris, which defaults (at least as of
1451 2.6) to an absurdly low limit of 64 file descriptors per process.
1452
1453 One way to increase the number of file descriptors is to set
1454 I<rlimitnofile> in F<inn.conf> to a higher value.  This will cause both
1455 startinnfeed and inndstart (the setuid root wrapper scripts that start
1456 innfeed and innd, respectively) to increase the file descriptor limits
1457 before they run the regular INN programs.  Note, however, that INN won't
1458 be able to increase the limits above the hard limits set by your operating
1459 system; on some systems, that hard limit is normally 256 file descriptors
1460 (Linux, for example).  On others, like Solaris, it's 1024.  Increasing the
1461 limit beyond that value may require serious system configuration work.
1462 (On some operating systems, it requires patching and recompiling the
1463 kernel.  On Solaris it can be changed in F</etc/system>, but for 2.6 or
1464 earlier the limit cannot be increased beyond 1024 without breaking
1465 select(2) and thereby breaking all of INN.  For current versions of Linux,
1466 you may be able to change the maximum by writing to
1467 F</proc/sys/fs/file-max>.)
1468
1469 256 file descriptors will probably be enough for all but the largest
1470 sites.  There is no harm in setting the limits higher than you actually
1471 need (provided they're set to something lower than or equal to your system
1472 hard limit).  C<256> is therefore a reasonable value to try.
1473
1474 If you're installing INN on a Solaris system, particularly if you're
1475 installing it on a dedicated news server machine, it may be easier to just
1476 increase the default file descriptor limit across the board for all
1477 processes.  You can do that by putting the line:
1478
1479     set rlim_fd_cur = 256
1480
1481 in F</etc/system> and rebooting.  You can increase it all the way to
1482 C<1024> (and may need to if you have a particularly large site), but that
1483 can cause RPC and some stdio applications to break.  It therefore probably
1484 isn't a good idea on a machine that isn't dedicated to INN.
1485
1486 =head1 Starting and Stopping the System
1487
1488 INN is started via the shell script F<rc.news>.  This must be run as the
1489 news user and not as root.  To start INN on system boot, you therefore
1490 want to put something like:
1491
1492     su - news -c /usr/local/news/bin/rc.news
1493
1494 in the system boot scripts.  If innd is stopped or killed, you can restart
1495 it by running rc.news by hand as the news user.
1496
1497 The rc.news script may also be used to shut down INN, with the C<stop>
1498 option:
1499
1500     su - news -c '/usr/local/news/bin/rc.news stop'
1501
1502 In the F<contrib> directory of this source tree is a sample init script
1503 for people using System V-style init.d directories.
1504
1505 =head1 Processing Newsgroup Control Messages
1506
1507 Control messages are specially-formatted messages that tell news servers
1508 to take various actions.  Cancels (commands to delete messages) are
1509 handled internally by INN, and all other control messages are processed by
1510 controlchan.  controlchan should be run out of F<newsfeeds> if you want
1511 your news server to process any control messages; see L<Configuring INN>
1512 for specific instructions.
1513
1514 The actions of controlchan are determined by F<control.ctl>, which lists
1515 who can perform what actions.  The primary control messages to be
1516 concerned with are C<newgroup> (to create a newsgroup), C<rmgroup> (to
1517 remove a newsgroup), and C<checkgroups> (to compare the list of groups
1518 carried in a hierarchy to a canonical list).  INN comes with a
1519 F<control.ctl> file that processes control messages in most major public
1520 hierarchies; if you don't want to act on all those control messages, you
1521 should remove from that file all entries for hierarchies you don't want to
1522 carry.
1523
1524 You can tell INN to just authenticate control messages based on the From
1525 header of the message, but this is obviously perilous and control messages
1526 are widely forged.  Many hierarchies sign all of their control messages
1527 with PGP, allowing news servers to verify their authenticity, and checking
1528 those signatures for hierarchies that use them is highly recommended.
1529 controlchan knows how to do this (using pgpverify) without additional
1530 configuration, but you do have to provide it with a public key ring
1531 containing the public keys of all of the hierarchy administrators whose
1532 control messages you want to check.
1533
1534 INN expects the public key ring to either be in the default location for a
1535 PGP public key ring for the news user (generally ~news/.gnupg for GnuPG
1536 and ~news/.pgp for old PGP implementations), or in pathetc/pgp
1537 (/usr/local/news/etc/pgp by default).  The latter is the recommended path.
1538 To add a key to that key ring, use:
1539
1540     gpg --import --homedir=/usr/local/news/etc/pgp <file>
1541
1542 where <file> is a file containing the hierarchy key.  Change the homedir
1543 setting to point to pathetc/pgp if you have INN installed in a non-default
1544 location.  If you're using the old-style PGP program, an equivalent
1545 command is:
1546
1547     env PGPPATH=/usr/local/news/etc/pgp pgp <file>
1548
1549 You can safely answer "no" to questions about whether you want to sign,
1550 trust, or certify keys.
1551
1552 The URLs from which you can get hierarchy keys are noted in comments in
1553 F<control.ctl>.  L<ftp://ftp.isc.org/pub/pgpcontrol/PGPKEYS> tries to
1554 collect the major hierarchy keys.
1555
1556 If you are using GnuPG, please note that the first user ID on the key will
1557 be the one that's used by INN for verification and must match the key
1558 listed in F<control.ctl>.  If a hierarchy key has multiple user IDs, you
1559 may have to remove all the user IDs except the one that matches the
1560 F<control.ctl> entry using C<gpg --edit-key> and the C<delkey> command.