Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

28.4. News Group (innd)

homepage: http://www.isc.org/inn.html

28.4.1. Ubuntu

过程 28.1. innd

  1. debian 安装

    sudo apt-get install inn2
    				
  2. 配置

    1. inn.conf

      cd /etc/news/
      chown news.news inn.conf
      domain:                 example.org
      server:                 localhost
      fromhost:               news.example.org
      moderatormailer:        openunix@163.com
      			    	
    2. storage.conf

      vi storage.conf
      method tradspool {
              newsgroups: *
              class: 0
      }
      			    	
    3. readers.conf

      vi readers.conf
      auth "local" {
              hosts: "*"
              default: "*"
      }
      
      access "local" {
              users: "*"
              newsgroups: "*"
      }
      			    	
  3. start

    /etc/init.d/innd start

    service innd start
    Starting INND system:                                      [  OK  ]
    				

    sudo ufw allow nntp

news://news.example.org

28.4.2. CentOS

# yum -y install inn		
		

readers.conf

# vim /etc/news/readers.conf		
auth "localhost" {
    hosts: "*"
    default: "*"
}

access "localhost" {
    users: "*"
    newsgroups: "*,!junk,!control,!control.*"
    access: RPA
}		
		

create a group

# /usr/lib/news/bin/ctlinnd newgroup test		
		

28.4.3. User Authentication

过程 28.2. Authinfo

  1. ckpasswd

    chown root /usr/lib/news/bin/auth/passwd/ckpasswd
    chmod 4555 /usr/lib/news/bin/auth/passwd/ckpasswd
    				
  2. shadow auth

    $ sudo vim /etc/news/readers.conf
    
    auth local {
            auth: "ckpasswd -s"
    }
    
    access local {
            users: "neo"
            newsgroups: "*,!junk,!control,!control.*"
    }
    				
  3. passwd file

    auth local {
           auth: "ckpasswd -f /etc/news/newsusers"
    }
    
    access local {
            users: "neo"
            newsgroups: "*,!junk,!control,!control.*"
    }
    				
  4. dbm,ndbm

    auth: "ckpasswd -d /etc/news/newsusers.ndbm"
    				

28.4.4. usenet 管理

Usenet新闻组有以下几大类:
  ●comp   计算机科学及相关的话题
  ●news   一般性的新闻话题
  ●rec    个人爱好、娱乐活动、艺术话题
  ●sci    科学研究、工程技术
  ●soc    社会类话题
  ●biz    商业类话题
  ●talk   有争议的话题
  ●misc   不属于以上几类的或有交叉的话题
  后来又增加了一类“alt”,这是一个范围较小、使用的人也较少的一个新闻组,
“alt”是“altemative” 的简写,是“替代”的意思,在这个组可以讨论各类话题。
		

创建组

sudo ctlinnd newgroup comp.lang.php
sudo ctlinnd newgroup comp.lang.perl
sudo ctlinnd newgroup comp.lang.python

sudo ctlinnd newgroup rec.photography
sudo ctlinnd newgroup rec.photographic.equipment
sudo ctlinnd newgroup rec.photographic.equipment.35mm
sudo ctlinnd newgroup rec.photographic.equipment.digital
sudo ctlinnd newgroup rec.photographic.equipment.lens
		

ctlinnd 手册

使用 ctlinnd 这 个 指 令 的 大 部 份 功 能 都 只 会 在 INND 开 启 后 才 可 以 使 用 , 例 如 就 是 新 增 Newsgroup , 您可 以 参考 ctlinnd 的 系 统 手 册 。 以 下 是 一 些 常 用 的 功 能 解 释 及 例 子 。

格 式 : ctlinnd newgroup [groupname]
例 子 : ctlinnd newgroup group.readers.discuss
 

这 个 作 法 是 新 增 一 个 名 为 "group.readers.discuss" 的 Newsgroup

格式: ctlinnd rmgroup [groupname]
例子: ctlinnd rmgroup group.test.unused
 

这个指令是可以删除 [groupname] 的 Newsgroup。

格式: ctlinnd cannel [message-id]
例子: ctlinnd cancel 3BCBF4B3.8AD48C8F@linux.org.hk
 

把 Message-ID 为 "3BCBF4B3.8AD48C8F@linux.org.hk" 的 文 章 删 除 , 而 这 个 Message-ID 可 以 在 "View Source" 时 看到 , 就 如 图 二 中 是 在 Netscape 中 的 画 面 , 图 中 打 圈 的 就 是 Message-ID 的 位 置, 不 过 要 注 意 是 某 些 的 Message-ID 是 包 括 了 "$" 号 的 , 这 时 可 别 忘 记 在 "$" 号 前 加 上 "\" , 也就 是 "\$"。

格式: ctlinnd pause [reason]
例子: ctlinnd pause maintenance
 

暂 停 一 切 的 连 线 及 不 准 许 新 的 文 章 , 这 个 适 合 作 为 暂 时 性 的 服 务 暂 停 。 而 [reason] 部 份是 关键 钥 , 您 可 以 输 入 任 何 的 [reason] , 下 文 再 谈 。

格式: ctlinnd throttle [reason]
例子: ctlinnd throttle upgrade
 

暂 停 一 切 的 连 线 及 不 准 许 新 的 文 章 , 并 且 也 会 关 闭 INND 的 "history" 檔 案 。 这 个 适 合 作为 长 时期 的 服 务 暂 停 。 而 [reason] 部 份 是 关 键 钥 , 您 可 以 输 入 任 何 的 [reason] , 下 文 再 谈 。

格式: ctlinnd go [reason]
例子: ctlinnd go maintenance
 

这 个 "go" 功 能 是 使 已 暂 停 服 务 的 innd 继 续 服 务 ,例 如 是 在 "pause" 或 是 "throttle" 后 ,可 以 使 用 这个 功 能 , 但 是 要 注 意 笔 者 刚 才 提 过 [reason] 一 事 , 在 "go" 中 使 用 的 [reason] 必须 要 与 "pause" 或是 "throttle" 中 的 [reason] 相 同 。
		

28.4.5. 通过SSL连接

$ cat /etc/news/sasl.conf
		

创建证书

$ sudo openssl req -new -x509 -nodes \
-out cert.pem -days 366 \
-keyout cert.pem

Generating a 1024 bit RSA private key
....................++++++
...............................++++++
writing new private key to 'cert.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:CN
State or Province Name (full name) [Berkshire]:Guang dong
Locality Name (eg, city) [Newbury]:Shen Zhen
Organization Name (eg, company) [My Company Ltd]:netkiller
Organizational Unit Name (eg, section) []:netkiller
Common Name (eg, your name or your server's hostname) []:netkiller.8800.org
Email Address []:openunix@163.com
		

设置权限

$ sudo chmod 640 cert.pem
		

28.4.6. src.rpm 安装

下载文件

wget ftp://rpmfind.net/linux/redhat/enterprise/4/en/os/i386/SRPMS/inn-2.3.5-12.src.rpm
cd /usr/src/redhat/SPECS
rpmbuild --ba inn.spec
cd /usr/src/redhat/RPMS/i386/
rpm -ivh *
			

makedbz

cd /var/lib/news
chmod 664 active
sudo -u news /usr/lib/news/bin/makedbz -i
mv history.n.dir history.dir
mv history.n.hash history.hash
mv history.n.index history.index
			

inncheck

sudo -u news /usr/lib/news/bin/inncheck
			

28.4.7. 常用新闻组

news://news.newsfan.net

news://news.nntp.hk

news://news.idsam.com