-*- text -*-

INNAdmin Installation Procedure
M.C. Widerkrantz <mc@hack.org>
2004-04-10

How to install the administration tools for INN.

* Install INN

First be sure to install an INN News server with ACL support. You can
find a full distribution or a patch against the normal distribution
here:

  http://hack.org/mc/hacks.html

After unpacking the tar ball, something like this would probably do:

  % ./configure --prefix=/news --with-perl
  % make

Make sure there is a news user on your system or create the user if
need be. Set the user's home directory to where you would like to
install INN, the admin scripts and, possibly, the Webnews WWW News
client. Typical values are /news or /home/news.

Then install INN with

  make install

and, as the news user, create the empty history database:

  % su - news
  % cd db
  % touch history
  % makedbz -i

Then manually rename the history.n.* files to history.*.

Create the log files (for instance news.notice, news.err, news.crit).
Edit your syslog configuration, most likely in /etc/syslog.conf and
restart your syslog daemon, usually by sending a HUP signal to
syslogd.

Edit the crontab entry (usually with crontab -e) for the news user to
run /news/bin/news.daily at least daily. See the man page for
news.daily for options you may want to add.

0 3 * * * /home/www/news/bin/news.daily expireover lowmark delayrm

Edit 

  ~news/etc/inn.conf

And insert 

  nnrpdauthfrom: true

if you want From line rewriting based on the access lists, and,

  nnrpdacl: true

to use Access Control Lists for newsgroup access. This last line
necessary for naf to work with INN at all.

Edit storage.conf to say how you want articles to be stored. Typical
values in storage.conf might be:

    # Store everything as timecaf.

    method timecaf {
	   newsgroups: *
	   class: 0
    }

and then add something to readers.conf
    
  # MC's TNG standard

  auth "remotes" {
      hosts: "*"
      auth: "mcpasswd -f /news/db/newsusers.db"
  }

Move db/admin/innadmin.conf to ~news/etc/

Go through innadmin.conf to see that everything is configured right.

You need to install Berkeley DB > v3 for access.pl and NAF to work. It
is, for example, in FreeBSD packages as db41, so do something like

  # pkg_add -r db41

You also need the Perl module BerkeleyDB.pm for access.pl and some of
the other the Perl scripts to work. Find it at CPAN and install it.

Edit config.in and point it to your Berkeley DB installation before
building. Build with

  perl Makefile.PL
  make

and, as root,

  make install

Now start the News server:

  $ rc.news

Voila!

You might want to include something like this if you have an rc.d type
system. I called it inn.sh and put it in /usr/local/etc/rc.d/ on my
FreeBSD system, which starts things automagically at boot time.

  #! /bin/sh

  case X"$1" in
  Xstart)
      if [ -x /home/news/bin/rc.news ]
      then
          printf "Starting inn: "
          su news -c /home/news/bin/rc.news
      fi
  ;;
  Xstop)
      if [ -x /home/news/bin/rc.news ]
      then
          su news -c '/home/news/bin/rc.news stop'
      fi
      exit 0
  ;;
  esac

See the file inn-2.4.1-mc/INSTALL if in doubt.

* Install Administration Scripts

Install or configure an HTTP server. I use thttpd, so I installed it
with

  # pkg_add -r thttpd

Edit the configuration file of thttpd.

  dir=/home/news/www
  user=news
  cgipat=**.cgi
  logfile=/home/news/log/thttpd.log
  pidfile=/home/news/run/thttpd.pid

If you go for a chrooted HTTP server, you will need to create a stand
alone, chrooted Perl installation. You will probably have to recompile
Perl and possibly make it include all the modules it needs statically
or move them into the chrooted environment.

Copy db/admin/* to wherever you want to keep your admin scripts, for
instance www/admin/.

Make a symbolic link to ~news/etc/innadmin.conf so the scripts can
find their stuff.

* Install WebNews

NAF has support for a much changed WebNews client. It is distributed
separately. This is just a placeholder for some configuration hints.

Copy webnews.cgi and webnews.conf to wherever you want to run it from,
say a directory called ~news/www/webnews/.

Edit webnews/webnews.conf to make sure the paths are correct.

Install the News::NNTPClient, News::NewsrcLock, News::Newsrc,
Set::IntSpan, Date::Parse, Date::Format and Date::Language Perl
modules which Webnews requires.

Tell your HTTP server about webnews and allow it to execute CGI
programs. Voila!

* Install the INN Admin scripts

Move all the scripts in db/admin to wherever you want to run them
from, say ~news/www/admin/.

NOTE: If you are going to run your INN Admin web scripts chrooted, be
sure to put the database files somewhere under the alternate root.

Edit the ~news/www/admin/innadmin.conf file to make sure the paths and
variables are correct.

You might want to run an HTTP server with an embedded Perl
interpreter.

* Install the mail gateway
