PttBBS:修订间差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
 
(未显示同一用户的10个中间版本)
第1行: 第1行:
'''PttBBS'''是一套[[BBS]]系統。
'''PttBBS'''是一套[[BBS]]系統。
== 相依性套件 ==
<syntaxhighlight lang="bash">
sudo apt install -y build-essential libboost-dev libgflags-dev libgrpc++-dev pmake protobuf-compiler protobuf-compiler-grpc; sudo apt clean
</syntaxhighlight>


== 環境設定 ==
== 環境設定 ==
第23行: 第29行:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
git clone https://github.com/ptt/pttbbs.git src; cd src; wget -O - https://raw.githubusercontent.com/clamtestbbs/innptt/master/0001-Revert-Remove-innbbsd.patch | git apply -
cd ~; git clone https://github.com/ptt/pttbbs.git; cd pttbbs; wget -O - https://raw.githubusercontent.com/clamtestbbs/innptt/master/0001-Revert-Remove-innbbsd.patch | git apply -
</syntaxhighlight>
</syntaxhighlight>


== 設定 ==
== 設定 ==


 先將<code>src/sample/pttbbs.conf</code>複製到<code>src/pttbbs.conf</code>:
 先將<code>pttbbs/sample/pttbbs.conf</code>複製到<code>pttbbs/pttbbs.conf</code>:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
cd ~/src; cp sample/pttbbs.conf .
cd ~/pttbbs; cp sample/pttbbs.conf .
</syntaxhighlight>
</syntaxhighlight>


第37行: 第43行:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
cd ~/src; sed -i -e '/^\/\/#define USE_PMORE/ a #define USE_PMORE\n#define USE_PFTERM' -e '/^\/\/#define SHMALIGNEDSIZE/ a #define SHMALIGNEDSIZE (1048576*4) // 4MB for x86_64' -e '/^\/\/#define TIMET64/ a #define TIMET64' pttbbs.conf
cd ~/pttbbs; sed -i -e '/^\/\/#define USE_PMORE/ a #define USE_PMORE\n#define USE_PFTERM' -e '/^\/\/#define SHMALIGNEDSIZE/ a #define SHMALIGNEDSIZE (1048576*4) // 4MB for x86_64' -e '/^\/\/#define TIMET64/ a #define TIMET64' pttbbs.conf
</syntaxhighlight>
</syntaxhighlight>


第69行: 第75行:
echo "@reboot ~/bin/shmctl init > /tmp/shmctl.log 2>&1" > ~/crontab.bbsadm; crontab ~/crontab.bbsadm
echo "@reboot ~/bin/shmctl init > /tmp/shmctl.log 2>&1" > ~/crontab.bbsadm; crontab ~/crontab.bbsadm
</syntaxhighlight>
</syntaxhighlight>
== 其他作業 ==
在開機時跑寄信的outmail:
<syntaxhighlight lang="bash">
@reboot ~/bin/outmail > /tmp/outmail.log 2>&1
</syntaxhighlight>
== 相關連結 ==
* [[PttWeb]]


== 外部連結 ==
== 外部連結 ==

2023年1月13日 (五) 16:39的最新版本

PttBBS是一套BBS系统。

相依性套件

sudo apt install -y build-essential libboost-dev libgflags-dev libgrpc++-dev pmake protobuf-compiler protobuf-compiler-grpc; sudo apt clean

环境设定

依照官方的Wiki建立bbs、bbsadm、bbsu(UTF-8环境用)三个账号。

sudo groupadd -g 99 bbs
sudo useradd -g bbs -r -s /home/bbs/bin/bbsrf -u 9999 bbs
sudo useradd -g bbs -r -s /bin/bash -u 9999 bbsadm
sudo useradd -g bbs -r -s /home/bbs/bin/utf8 -u 9999 bbsu

下载

先切到bbsadm权限下:

sudo su - bbsadm

然后拉官方版本,并且使用innbbsd的patch:

cd ~; git clone https://github.com/ptt/pttbbs.git; cd pttbbs; wget -O - https://raw.githubusercontent.com/clamtestbbs/innptt/master/0001-Revert-Remove-innbbsd.patch | git apply -

设定

先将pttbbs/sample/pttbbs.conf复制到pttbbs/pttbbs.conf

cd ~/pttbbs; cp sample/pttbbs.conf .

照官方提供的说明修改pttbbs.conf(站名、IP等资讯),然后开启64bits平台与piaip所写的两个功能:

cd ~/pttbbs; sed -i -e '/^\/\/#define USE_PMORE/ a #define USE_PMORE\n#define USE_PFTERM' -e '/^\/\/#define SHMALIGNEDSIZE/ a #define SHMALIGNEDSIZE (1048576*4) // 4MB for x86_64' -e '/^\/\/#define TIMET64/ a #define TIMET64' pttbbs.conf

编译

修改完后先清除再编译会比较好(尤其是.conf或是.h这些会改变很多地方的档案):

pmake clean all

安装

第一次安装:

pmake install; cd ~; bin/initbbs -DoIt; cp ~/src/sample/etc/*.help ~/etc; cd ~/bin; ln -s bbsrf utf8

前制作业

在连入PttBBS前,要先处理好shared memory:

~/bin/shmctl init

并且设定开机时会自动执行:

echo "@reboot ~/bin/shmctl init > /tmp/shmctl.log 2>&1" > ~/crontab.bbsadm; crontab ~/crontab.bbsadm

其他作业

在开机时跑寄信的outmail:

@reboot ~/bin/outmail > /tmp/outmail.log 2>&1

相关连结

外部链接