From Wikislax

(Difference between revisions)
Jump to: navigation, search
(Configuring INN)
(Configuring INN)
Line 123: Line 123:
'''INN''' executes the daily script '''news.daily''', which writes its report in file '''news.daily''', then addressed to the '''news''' user.  Execution of '''news.daily''' must be configured in the news '''crontab'''. Here is an example for a daily execution at 13:30 :
'''INN''' executes the daily script '''news.daily''', which writes its report in file '''news.daily''', then addressed to the '''news''' user.  Execution of '''news.daily''' must be configured in the news '''crontab'''. Here is an example for a daily execution at 13:30 :
# su news
  $ crontab -e
  $ crontab -e

Revision as of 13:47, 2 June 2012


What is INN ?

INN (InterNet News) is the leading Usenet news software, available from the ISC website.

The news articles received from peer servers on the Internet can also be viewed by clients using a newsreader such as slrn or Thunderbird. It is possible to read and to answer to articles.

Installing INN

Download and untar in /usr/local. Installation is described very well in the INSTALL file also available from the isc website. INN runs as the news user. This user is present by default on Slackware, but the home directory must be changed to match INN's : /usr/local/news.

# usermod --home /usr/local/news news
# tar -C /usr/local -xvf inn-x.y.z
# cd /usr/local
# chown -R root:root inn-x.y.z
# cd inn-x.y.z
# less INSTALL
# ./configure --help | less
# ./configure --prefix=/usr/local/news --libdir=/usr/local/news/lib64 --mandir=/usr/local/man \
--with-sendmail --with-perl --with-python --with-berkeleydb --with-zlib --with-openssl --with-sasl
# make
# make install
# make clean

Configuring INN

INN runs as the news user, so login or su as news in order not to break the file permissions. There are 27 configuration files ! but it's possible to work only with a small subset of files minimally modified. In addition the default configuration files provided with the software are very well written and commented, and man pages are available.

inn.conf : main configuration file, to specify the host, path, and certificates. As INN is ran as news, let us make a copy of the server private key hat will be readable only by this user :

# cd /etc/ssl/private
# cp mtakey.pem.unsecure news.mtakey.pem.unsecure
# chown news:news news.mtakey.pem.unsecure

organization:           "studioware"
pathnews:               /usr/local/news

tlscafile:              /etc/ssl/certs/cacert.pem
tlscapath:              /etc/ssl/certs
tlscertfile:            /etc/ssl/certs/mtacert.pem
tlskeyfile:             /etc/ssl/private/news.mtakey.pem.unsecure

cycbuff.conf : configuration of cyclic buffers. Cyclic buffers are a more efficient version of the article storage mode, in a reduced number of files or in block peripherals.


Create the files using :

# mkdir -p /var/news/cycbuffs
# chown -R news:news /var/news
# chmod -R 750 /var/news
# su news
$ dd if=/dev/zero of=/var/news/cycbuffs/one bs=1K count=512000
$ dd if=/dev/zero of=/var/news/cycbuffs/two bs=1K count=512000
$ chmod 640 /var/news/cycbuffs/*

expire.ctl : expiration of articles. remember indicates the period during which the message headers will be kept after body elimination. This is to avoid re-taking the articles if offered again. Other options do not apply when using cyclic buffers. In this case expiration is on a first in first out basis.


incoming.conf : this file affords defining the sites with which you have agreements and that feed you in fresh news. As there are probably none, you do not need to modify it. How are you going to feed your site then ? Using an external feeding software sucknews, which presents itself to your Internet Service Provider like a simple news reader. sucknews is described in detail further on.

inn.conf : general options of the program. The line organization must be modified, replacing A poorly-installed InterNetNews site by your organization name. ovhmethod is the method used to store overview data. ovdb looks more efficient than the others so we've chosen that. artcutoff is the retention duration of the articles in number of days. It is not possible to feed your site with articles older than this value, that it can be interesting to increase as by default it is only 10 days. The pathhost must contain the site FQDN, that must be resolvable (for instance present in the /etc/hosts file).

newsfeeds : list the newsfeeds that you are going to manage. A file with the name specified will be created in /usr/local/news/spool/outgoing and will contain one line per article to post. In the following example, all the groups except control and junk will be posted.


readers.conf : list of access authorizations. For a general access, except to the control groups :

auth "theworld" {
    hosts: *
    default: "<theworld>"

access "theworld" {
    users: "<theworld>"
    newsgroups: "*,!control*,!junk"
    access: RPA

storage.conf : general options for articles storage. In the example, cnfs corresponds to the cyclic buffers :

method cnfs {
    newsgroups: *
    class: 2
    options: ONETWO

Next step is to initialize the history database :

$ cd /usr/local/news
$ bin/makedbz -i -s 100000 -o

INN sends maintenance mails to the news user, so we need to create the person in OpenLDAP and the mailbox in Cyrus-IMAP  :

# vi news.ldif
dn: cn=news,dc=studioware,dc=com
objectclass: person
cn: news
sn: news
userPassword: myPassword
# ldapadd -x -D "cn=Manager,dc=studioware,dc=com" -W -f news.ldif
# cyradm --user postmaster --auth plain localhost
localhost> cm
localhost> cm
localhost> cm
localhost> cm
localhost> cm
localhost> sq 307200
localhost> quit

INN executes the daily script news.daily, which writes its report in file news.daily, then addressed to the news user. Execution of news.daily must be configured in the news crontab. Here is an example for a daily execution at 13:30 :

# su news
$ crontab -e
# 00 13 * * * /usr/local/news/bin/
30 13 * * * /usr/local/news/bin/news.daily expireover lowmark

INN should now be ready to work.

Running INN

To start INN automatically at system startup add these lines to the /etc/rc.d/rc.local file :

# start inn
if [ -x /usr/local/news/bin/ ]; then
        echo "Starting inn: sudo -u news /usr/local/news/bin/ start"
        sudo -u news /usr/local/news/bin/ start

To stop INN automatically at system shutdown add these lines to the /etc/rc.d/rc.local_shutdown file :

# stop inn
if [ -x /usr/local/news/bin/ ]; then
        echo "Stopping inn: sudo -u news /usr/local/news/bin/ stop"
        sudo -u news /usr/local/news/bin/ stop

Getting Articles

The list of Newsgroups to relay can be defined by editing the db/active file manually (innd must be stopped) or using ctlinnd. The definitions take no wildcard, meaning that the Newsgroups must be entered one by one. The ISC maintain a list.

# ctlinnd newgroup y me@mysite

But as no news peer has been defined in our configuration INN will not get articles for these newsgroups. So we'll have to get them from our Internet Service Provider in an other way, using as alternative the sucknews software. That's the object of next page.

RoundCube Main Page Sucknews
Personal tools