<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;

  <!ENTITY leafnode-download-http "&sourceforge-repo;/leafnode/leafnode-&leafnode-version;.tar.bz2">
  <!ENTITY leafnode-download-ftp "ftp://ftp.gwdg.de/pub/linux/mirrors/sunsite/system/news/transport/leafnode-&leafnode-version;.tar.bz2">
  <!ENTITY leafnode-md5sum "88552c5cc91cb27146c8906b2d33289d">
  <!ENTITY leafnode-size "428 KB">
  <!ENTITY leafnode-buildsize "6.2 MB">
  <!ENTITY leafnode-time "0.1 SBU">
]>

<sect1 id="leafnode" xreflabel="Leafnode-&leafnode-version;">
  <?dbhtml filename="leafnode.html"?>

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2012-05-12 17:54:09 -0400 (Sat, 12 May 2012) $</date>
  </sect1info>

  <title>Leafnode-&leafnode-version;</title>

  <indexterm zone="leafnode">
    <primary sortas="a-Leafnode">Leafnode</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to Leafnode</title>

    <para><application>Leafnode</application> is an NNTP server designed
    for small sites to provide a local USENET spool.</para>

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>Download (HTTP): <ulink url="&leafnode-download-http;"/></para>
      </listitem>
      <listitem>
        <para>Download (FTP): <ulink url="&leafnode-download-ftp;"/></para>
      </listitem>
      <listitem>
        <para>Download MD5 sum: &leafnode-md5sum;</para>
      </listitem>
      <listitem>
        <para>Download size: &leafnode-size;</para>
      </listitem>
      <listitem>
        <para>Estimated disk space required: &leafnode-buildsize;</para>
      </listitem>
      <listitem>
        <para>Estimated build time: &leafnode-time;</para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">Leafnode Dependencies</bridgehead>

    <bridgehead renderas="sect4">Required</bridgehead>
    <para role="required"><xref linkend="pcre"/> and
    <xref linkend="tcpwrappers"/></para>

    <bridgehead renderas="sect4">Recommended</bridgehead>
    <para role="recommended">
      <!-- <xref linkend="xinetd"/> and -->
      <xref linkend="fcron"/>
    </para>

    <para condition="html" role="usernotes">User Notes:
    <ulink url="&blfs-wiki;/leafnode"/></para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of Leafnode</title>

    <para>As the <systemitem class="username">root</systemitem> user, create
     the group and user <systemitem class="username">news</systemitem>,
    if not present:</para>

<screen role="root"><userinput>groupadd -g 36 news &amp;&amp;
useradd -c "Leafnode News Server" -d /var/spool/news -g news \
        -u 36 news</userinput></screen>

    <para>Install <application>Leafnode</application> by running the following
    commands:</para>

<screen><userinput>./configure --prefix=/usr \
    --localstatedir=/var --sysconfdir=/etc/leafnode \
    --with-lockfile=/var/lock/leafnode/fetchnews.lck &amp;&amp;
make</userinput></screen>
    <para>To test the results, issue: <command>make check</command>.</para>
    <para>Now, as the <systemitem class="username">root</systemitem> user:</para>

<screen role="root"><userinput>make install</userinput></screen>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <para><parameter>--localstatedir=/var</parameter>: Change the default
    spool directory of <filename class="directory">/usr/var</filename>.</para>

    <para><parameter>--sysconfdir=/etc/leafnode</parameter>:
    <application>Leafnode</application> reads its configuration data from a
    file called <filename>config</filename> which will be created in
    <filename class="directory">/etc/leafnode</filename> to
    avoid any potential conflict with other packages.</para>

    <para><command>make update</command>: Run this command if you are upgrading
    from a very old version of <application>Leafnode</application>.</para>

  </sect2>

  <sect2 role="configuration">
    <title>Configuring Leafnode</title>

    <sect3 id="leafnode-config">
      <title>Config Files</title>

      <para><filename>/etc/leafnode/config</filename>,
      <filename>/etc/nntpserver</filename>,
      <filename>/etc/sysconfig/createfiles</filename>
      <filename>/etc/inetd.conf</filename> or
      <!-- <filename>/etc/xinetd.conf</filename> or
      <filename>/etc/xinetd.d/nntp</filename>--></para>

      <indexterm zone="leafnode leafnode-config">
        <primary sortas="e-etc-leafnode-config">/etc/leafnode/config</primary>
      </indexterm>

      <indexterm zone="leafnode leafnode-config">
        <primary sortas="e-etc-nntpserver">/etc/nntpserver</primary>
      </indexterm>
<!--
      <indexterm zone="leafnode leafnode-config">
        <primary sortas="e-etc-xinetd.conf">/etc/xinetd.conf</primary>
      </indexterm>
-->
      <indexterm zone="leafnode leafnode-config">
        <primary sortas="e-etc-inetd.conf">/etc/inetd.conf</primary>
      </indexterm>

      <indexterm zone="leafnode leafnode-config">
        <primary sortas="e-etc-sysconfig-createfiles">/etc/sysconfig/createfiles</primary>
      </indexterm>
<!--
      <indexterm zone="leafnode leafnode-config">
        <primary sortas="e-etc-xinetd.d-nntp">/etc/xinetd.d/nntp</primary>
      </indexterm>
-->
    </sect3>

    <sect3>
      <title>Configuration Information</title>

      <para>The <filename>/etc/leafnode/config</filename> file must be
      edited to reflect the name of the upstream NNTP provider. Copy the
      example configuration file to <filename>/etc/leafnode/config</filename>
      and save the original for reference:</para>

<screen role="root"><userinput>cp /etc/leafnode/config.example /etc/leafnode/config</userinput></screen>

      <para>Change the</para>

<screen><literal>server = </literal></screen>

      <para>entry to reflect your news provider.</para>

      <para>The <filename>/etc/nntpserver</filename> file must contain
      127.0.0.1 to prevent news clients from reading news from the upstream
      feed. Create this file using the following command:</para>

<screen role="root"><userinput>cat &gt; /etc/nntpserver &lt;&lt; "EOF"
<literal>127.0.0.1</literal>

EOF</userinput></screen>

      <para>The <command>/etc/rc.d/init.d/cleanfs</command> script, part
      of the LFS bootscript package, will remove the
      <filename class="directory">/var/lock/leafnode</filename> directory
      during the system boot sequence. Install the following line in the
      <filename>/etc/sysconfig/createfiles</filename> file to re-create the
      directory:</para>

<screen><literal>/var/lock/leafnode   dir   2775   news   news</literal></screen>

      <para><application>Leafnode</application> may be configured to
      use <command>inetd</command> by adding an entry to the
      <filename>/etc/inetd.conf</filename> file with the following
      command:</para>

<screen role="root"><userinput>echo "nntp stream tcp nowait news /usr/sbin/tcpd /usr/sbin/leafnode" \
&gt;&gt; /etc/inetd.conf</userinput></screen>

      <para>Issue a <command>killall -HUP inetd</command> to reread the
      changed <filename>inetd.conf</filename> file.</para>
<!--
      <para>If you use <command>xinetd</command>, the following command will
      create the <application>Leafnode</application> file as
      <filename>/etc/xinetd.d/nntp</filename>:</para>

<screen role="root"><userinput>cat &gt;&gt; /etc/xinetd.d/nntp &lt;&lt; "EOF"
<literal># Begin /etc/xinetd.d/nntp

        service nntp
        {
           flags           = NAMEINARGS NOLIBWRAP
           socket_type     = stream
           protocol        = tcp
           wait            = no
           user            = news
           server          = /usr/sbin/tcpd
           server_args     = /usr/sbin/leafnode
           instances       = 7
           per_source      = 3
        }

# End /etc/xinetd.d/nntp</literal>
EOF</userinput></screen>

      <para>Issue a <command>killall -HUP xinetd</command> to reread the
      changed <filename>xinetd.conf</filename> file.</para>
-->
      <para>Add entries to the <systemitem class="username">root</systemitem>
      or <systemitem class="username">news</systemitem> user's crontab to run
      the <command>fetchnews</command> and <command>texpire</command> commands
      at the desired time intervals.</para>

    </sect3>

  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Programs</segtitle>
      <segtitle>Installed Libraries</segtitle>
      <segtitle>Installed Directories</segtitle>

      <seglistitem>
        <seg>applyfilter, checkgroups, fetchnews, leafnode,
        leafnode-version, newsq, and texpire</seg>
        <seg>None</seg>
        <seg>/etc/leafnode, /var/lock/leafnode, and /var/spool/news</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="applyfilter">
        <term><command>applyfilter</command></term>
        <listitem>
          <para>filters newsgroup articles according to regular
          expressions.</para>
          <indexterm zone="leafnode applyfilter">
            <primary sortas="b-applyfilter">applyfilter</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="checkgroups">
        <term><command>checkgroups</command></term>
        <listitem>
          <para>inserts newsgroup titles into the newsgroup database.</para>
          <indexterm zone="leafnode checkgroups">
            <primary sortas="b-checkgroups">checkgroups</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="fetchnews">
        <term><command>fetchnews</command></term>
        <listitem>
          <para>sends posted articles to and retrieves new articles from an
          upstream news server.</para>
          <indexterm zone="leafnode fetchnews">
            <primary sortas="b-fetchnews">fetchnews</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="leafnode-prog">
        <term><command>leafnode</command></term>
        <listitem>
          <para>is an NNTP server daemon.</para>
          <indexterm zone="leafnode leafnode-prog">
            <primary sortas="b-leafnode">leafnode</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="leafnode-version">
        <term><command>leafnode-version</command></term>
        <listitem>
          <para>prints the <application>Leafnode</application> version.</para>
          <indexterm zone="leafnode leafnode-version">
            <primary sortas="b-leafnode-version">leafnode-version</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="newsq">
        <term><command>newsq</command></term>
        <listitem>
          <para>shows articles waiting to be sent upstream.</para>
          <indexterm zone="leafnode newsq">
            <primary sortas="b-newsq">newsq</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="texpire">
        <term><command>texpire</command></term>
        <listitem>
          <para>expires old articles and unread groups.</para>
          <indexterm zone="leafnode texpire">
            <primary sortas="b-texpire">texpire</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
