★ 快速移機手冊 ★
一、安裝作業系統
二、建立 BBS 帳號
三、安裝 BBS
四、設定 BBS 環境 -- (A)如果有 inetd【FreeBSD】
四、設定 BBS 環境 -- (B)如果有 xinetd【Linux】
四、設定 BBS 環境 -- (C)如果沒有 inetd/xinetd
五、其他設定
六、享用您自己的 BBS
本文件是寫給要安裝 itoc 所維護的 bbs 程式版本所使用的,並不適用
其他 bbs 版本。
一、安裝作業系統
本程式已證明在 FreeBSD 及 Linux 都可以運作正常,其他系統我沒有
試過,所以不清楚。
安裝作業系統時就像平常安裝一樣,沒什麼特別要注意的,唯一要提醒
您的是,請安裝 sed awk lynx make gcc 等程式,因為 bbs 會用到。
二、建立 BBS 帳號
以下所有的指令都是在新機器上執行。
以 root 身份登入。
-root- # mkdir /home/bbs
-root- # vipw
如果您是 FreeBSD 的話,在最後一行加上
bbs:*:9999:99::0:0:BBS Administrator:/home/bbs:/bin/tcsh
如果您是 Linux 的話,在最後一行加上
bbs:x:9999:999:BBS Administrator:/home/bbs:/bin/bash
(當然您也可以用 pw 或 useradd,adduser 的指令來完成相同的動作)
-root- # joe /etc/group
(假設編輯器是 joe,如果不是的話,請自行改變)
如果您是 FreeBSD 的話,在最後一行加上
bbs:*:99:bbs
如果您是 Linux 的話,在最後一行加上
bbs:*:999:bbs
(當然您也可以用 pw 或 groupadd 的指令來完成相同的動作)
-root- # passwd bbs
輸入 bbs 的密碼
接下來將舊機器的 /home/bbs 整個目錄搬到新機器上的 /home/bbs
您可以拔硬碟、用 cp、用 tar …等各式各樣的方法都可以。
-root- # chown -R bbs:bbs /home/bbs
三、安裝 BBS
以 bbs 身份登入。
-bbs- % joe /home/bbs/src/include/config.h
修改 HOST_ALIASES,把您所有的 fqdn 都加進去
#define HOST_ALIASES {MYHOSTNAME, MYIPADDR, \
"wolf.twbbs.org", "wolf.twbbs.org.tw", \
NULL}
如果您是 Linux 的話,改 BBSGID 為 999
#define BBSGID 99 /* Linux 請設為 999 */
如果您是 FreeBSD 的話
那麼 BBSGID 維持是 99
如果您的 lynx 不是裝在以下這個路徑的話,還要改
(通常若不是在 /usr/local/bin/lynx 就是在 /usr/bin/lynx)
#define LYNX_PATH "/usr/local/bin/lynx --source" /* lynx 的絕對路徑 */
-bbs- % cd /home/bbs/src; make clean freebsd install (若系統是 FreeBSD,請執行此行)
-bbs- % cd /home/bbs/src; make clean linux install (若系統是 Linux,請執行此行)
您需要等待一段時間來完成編譯
-bbs- % crontab /home/bbs/doc/crontab
把 doc/crontab 的內容加入 crontab
四、設定 BBS 環境 -- (A)如果有 inetd
如果沒有 /etc/inetd.conf 這檔案,請跳到五(B),通常 FreeBSD 應該有
inetd 才對。
以 root 身份登入。
-root- # joe /etc/inetd.conf
刪除原本的二行 (前面加上 # 即可)
#telnet stream tcp nowait root /usr/libexec/telnetd telnetd
#telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd
加入以下數行
#
# MapleBBS
#
telnet stream tcp wait bbs /home/bbs/bin/bbsd bbsd -i
finger stream tcp wait bbs /home/bbs/bin/bguard bguard -i
pop3 stream tcp wait bbs /home/bbs/bin/bpop3d bpop3d -i
gopher stream tcp wait bbs /home/bbs/bin/gemd gemd -i
smtp stream tcp wait bbs /home/bbs/bin/bmtad bmtad -i
xchat stream tcp wait bbs /home/bbs/bin/xchatd xchatd -i
bbsnntp stream tcp wait bbs /home/bbs/innd/innbbsd innbbsd -i
-root- # joe /etc/rc.local
加入以下數行 (這檔案有可能原本是沒有任何文字的開新檔案)
#!/bin/sh
#
# MapleBBS
#
su bbs -c '/home/bbs/bin/camera'
su bbs -c '/home/bbs/bin/account'
四、設定 BBS 環境 -- (B)如果有 xinetd
如果沒有 /etc/xinetd.d/ 這目錄,請跳到五(C),通常 Linux 應該有
xinetd 才對。
以 root 身份登入。
-root- # joe /etc/xinetd.d/telnet
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = yes
user = bbs
server = /home/bbs/bin/bbsd
server_args = -i
}
-root- # joe /etc/xinetd.d/xchat
service xchat
{
disable = no
flags = REUSE
socket_type = stream
wait = yes
user = bbs
server = /home/bbs/bin/xchatd
server_args = -i
}
-root- # joe /etc/xinetd.d/bbsnntp
service bbsnntp
{
disable = no
flags = REUSE
socket_type = stream
wait = yes
user = bbs
server = /home/bbs/innd/innbbsd
server_args = -i
}
-root- # joe /etc/xinetd.d/pop3
service pop3
{
disable = no
socket_type = stream
wait = yes
user = bbs
server = /home/bbs/bin/bpop3d
server_args = -i
}
-root- # joe /etc/xinetd.d/finger
service finger
{
disable = no
socket_type = stream
wait = yes
user = bbs
server = /home/bbs/bin/bguard
server_args = -i
}
-root- # joe /etc/xinetd.d/smtp
service smtp
{
disable = no
socket_type = stream
wait = yes
user = bbs
server = /home/bbs/bin/bmtad
server_args = -i
}
-root- # joe /etc/xinetd.d/gopher
service gopher
{
disable = no
flags = REUSE
socket_type = stream
wait = yes
user = bbs
server = /home/bbs/bin/gemd
server_args = -i
}
-root- # joe /etc/rc.d/rc.local
加入以下數行 (這檔案有可能原本是沒有任何文字的開新檔案)
#!/bin/sh
#
# MapleBBS
#
su bbs -c '/home/bbs/bin/camera'
su bbs -c '/home/bbs/bin/account'
四、設定 BBS 環境 -- (C)如果沒有 inetd/xinetd
沒 inetd 也沒 xinetd,改用 standalone 啟動
以 root 身份登入。
-root- # joe /etc/rc.local
加入以下數行 (這檔案有可能原本是沒有任何文字的開新檔案)
#!/bin/sh
#
# MapleBBS
#
/home/bbs/bin/bbsd
/home/bbs/bin/bmtad
/home/bbs/bin/bpop3d
/home/bbs/bin/gemd
/home/bbs/bin/bguard
/home/bbs/bin/xchatd
/home/bbs/innd/innbbsd
su bbs -c '/home/bbs/bin/camera'
su bbs -c '/home/bbs/bin/account'
五、其他設定
以 root 身份登入。
-root- # joe /etc/services
加入以下數行
xchat 3838/tcp
xchat 3838/udp
bbsnntp 7777/tcp usenet #Network News Transfer Protocol
bbsnntp 7777/udp usenet #Network News Transfer Protocol
-root- # joe /etc/login.conf
修改 md5 為 des 編碼,Linux 請跳過此步驟
default:\
:passwd_format=des:\
-root- # joe /etc/rc.conf
把 YES 改成 NO,Linux 請跳過此步驟
sendmail_enable="NO"
-root- # reboot
重開機吧
六、享用您自己的 BBS
您的 BBS 應該已經移好了,試著 telnet 看看,那就這樣好好享用吧。
--
交大電子 杜宇軒
E-Mail: itoc.bbs@bbs.tnfsh.tn.edu.tw
WWW: http://home.pchome.com.tw/soho/itoc
|