0. Since version 1.9.17ma1, leafnode uses GNU automake. All standard
   targets exist. If you want to hack on leafnode, do remember to use
   --enable-maintainer-mode in ./configure below in step #1.

MACOS X SPECIAL PREPARATIONS
----------------------------
The PCRE version that ships with leafnode is too old to compile on
MacOS X. However, there are reports that PCRE 3.9 with --disable-shared is
sufficient, so: 1. download PCRE from http://www.pcre.org/. 2. unpack
the sources. 3. ./configure --disable shared. 4. make 5. (as root) make
install 6. continue with leafnode installation. Note, you only need to
install PCRE once. Future leafnode 1.9.x updates will pick up the
version you installed this time, so you won't have to reinstall PCRE
when you want to update leafnode 1.9.x.
----------------------------

1. (as user) Since version 1.9, leafnode uses GNU autoconf to determine what
   machine it will run on. Type

	sh ./configure

   to create an appropriate Makefile and config.h .  If you have and
   want to use IPV6, invoke "configure" with the --with-ipv6 flag.

   Remember that when you are updating a previously installed version of
   leafnode, you need to configure the new version of leafnode to
   overwrite the old one. You do this with the "configure --prefix"
   option. For example, if leafnode had been previously installed in
   /opt, you would configure leafnode with the command "./configure
   --prefix=/opt".  Further options are --with-spooldir, --sysconfdir,
   --with-lockfile to determine the location of the spooldir (defaults
   to /var/spool/news), configuration directory (defaults to
   /etc/leafnode if prefix is unset, PREFIX/etc otherwise) and of the
   lock file (defaults to /var/lock/news/leafnode.lock)

2. (as user) Type

	make

   There should be no errors.

3. (as root) Create a "news" user if you don't have one.

4. (as root) Type
	make install

5. (as root) If you are updating leafnode from a version before 1.9.3
   (including all 1.9.3 beta versions before 1.9.3b5), "make
   update". This will call the update.sh shell script provided with
   leafnode. Your groupinfo file will be reformatted and some other
   files will be moved around. In case something goes wrong, you will
   find your old groupinfo file in
   /var/spool/news/leaf.node/groupinfo.old. If everything works out
   correctly, you can delete this file (it is not needed any more).

6. (as root) Edit $(sysconfdir)/config ($(sysconfdir) defaults to
   /etc/leafnode if it is unset and prefix is unset, to $prefix/etc if
   prefix is set.  For documentation, see config.example and
   leafnode(8). 

6a. It is absolutely necessary to change the "server" parameter to point
    it to your upstream news server (generally the one of your IP provider).

6b. Make sure $NNTPSERVER or /etc/nntpserver points to your own host so
    clients will talk to leafnode rather than try to go to the upstream
    server.  If you want to use filtering of the incoming spool, see "FILTER
    FILE" in the README.

6c. You definitely want to use "initialfetch = 100" or something in the
    config file, to prevent fetchnews from filling up your disk when
    hitting a high-volume newsgroup.

7. (as root) If your system does not have a fully qualified domain name
   (Debian default installs belong to this group of systems), edit
   /etc/hosts to add one, for example, if your /etc/hosts has a line

   192.168.0.1 debian

   make that

   192.168.0.1 debian.example.com debian

   IMPORTANT: debian.example.com must be replaced by a real fully
   qualified domain name. Making up host names will cause trouble, like
   posts being discarded at the upstream server, posts being discarded
   when Message-IDs of different postings clash and other troubles.

8. (as news) Set up a cron job to run texpire every night or maybe every
   week.  Here is my crontab line, which runs nightly:

0 4 * * * /usr/local/sbin/texpire

   I did "crontab -u news -e" as root to edit the crontab file, and added
   this line.  Substituting "1" for the third "*", thus:

0 4 * * 1 /usr/local/sbin/texpire

   tells cron to run texpire at 4am Monday morning. See man crontab for
   details.

9. Make sure fetchnews is run at the appropriate time.  If you have a
   full-time link, run it out of cron (as "news" again), if not, run it
   when your connection to the net is established.  If it is run as
   root, it will change user to "news". If you use PPP, you can probably
   run fetchnews from /etc/ppp/ip-up.local or /etc/ppp/ip-up.

10. (as root) Edit /etc/hosts.deny to add a line:
    leafnode: ALL

    Edit /etc/hosts.allow to add a line:
    leafnode: 127.0.0.1

    If you run leafnode in a LAN, you can of course add netmasks for the
    hosts in your LAN, like (still to /etc/hosts.allow):

    leafnode: 127.0.0.1 192.168.0.0/255.255.255.0

    See man hosts_access(5) and hosts_options(5) for more information.

11. (as root) Edit /etc/inetd.conf so that $(BINDIR)/leafnode is executed
    for incoming NNTP connections.  Here is my inetd.conf line (insert
    it at the leftmost column, without leading spaces!)

    nntp stream tcp nowait news /usr/sbin/tcpd /usr/local/sbin/leafnode

    This starts leafnode for all connections on the nntp port, subject to
    /etc/hosts.allow and /etc/hosts.deny screening.  If you don't have
    /usr/sbin/tcpd, fetch the tcp_wrappers package and install it.

    Using leafnode without tcpd is not supported and opens your computer
    to abuse (even happens on modem lines that are only connected during
    the fetch!)

    After these changes, force inetd to read the changed configuration file
    by sending it the HANGUP signal. To achieve this, issue the following
    command (as root):

    kill -HUP `cat /var/run/inetd.pid`

12. (as root or news) Run fetchnews.  The first run will take some time
    since fetchnews reads a list of all newsgroups from your upstream
    server.  With an 28.8 modem, it can take as long as 60 minutes
    (depending on how many newsgroups your provider offers). To see
    fetchnews working, run it with -vvv. If you update leafnode from a
    version previous to 1.6, the format of the groupinfo file has
    changed. You should therefore run fetchnews with the parameter -f.

13. (as user) Read news using an NNTP client (with $NNTPSERVER or
    /etc/nntpserver pointing to your own host). Select the groups you
    want to read in the future. You will find them empty except a
    default article.  Reading this article is necessary with some
    newsreaders to select the groups for further fetching.

    After this, you should have empty files in
    /var/spool/news/interesting.groups/ for every group you want to
    read.

14. (as root or news) Run fetchnews again. This run should pick up all
    the groups you want to read.

Cornelius Krasel <krasel@wpxx02.toxi.uni-wuerzburg.de>
Matthias Andree <matthias.andree@gmx.de>
