KBS安装指南 |
KBS安装指南 X5JPXX http://blog.numino.net/ 一些环境准备 9x5FEG http://blog.numino.net/ 虚机(virtualbox 5.1+, 比如5.1.26)环境搭建 DfwegG http://blog.numino.net/ 如果没有开启vt,需要开启,首先开机进入BIOS,Security,Virtualization,选择Enable即可 17J4ow http://blog.numino.net/ 安装ubuntu12.04.5,地址 : Bm74qw http://blog.numino.net/ http://mirrors.163.com/ubuntu-releases/12.04/ubuntu-12.04.5-desktop-amd64.iso 1aeVq6 http://blog.numino.net/ 比较古老的32位的或不支持vt技术的cpu选择: 9d98Y0 http://blog.numino.net/ http://mirrors.163.com/ubuntu-releases/12.04/ubuntu-12.04.5-desktop-i386.iso 0cSOzH http://blog.numino.net/ 虚机网络断开安装,否则会自动安装更新,耗时比较久, sTAkpo http://blog.numino.net/ virtualbox - 显示 - 启用3d加速 o3rFfn http://blog.numino.net/ 安装过程中,配置用户名设置为 bbs 0F691x http://blog.numino.net/ 安装完成后去掉iso挂载,网络选择网络地址转换NAT,重启后 SUc65L http://blog.numino.net/ virtuabbox, 设备-安装增强功能(和主机共享文件) nwsmQT http://blog.numino.net/ df 查看光盘挂载地址 om4km8 http://blog.numino.net/ cd /media/VBOXADDITIONS_5.1_xxxx (xxxx为上面命令结果补全) 4C4b8O http://blog.numino.net/ sudo ./VBoxLinuxAdditions.run 22IbZ6 http://blog.numino.net/ 重启,设备 - 共享文件夹, 选择windows主机的文件夹映射为 bbs目录为共享目录,选择固定分配,自动挂载 wckdv9 http://blog.numino.net/ sudo mount -t vboxsf bbs /mnt NjZsRz http://blog.numino.net/ 添加国内源 1rRHcG http://blog.numino.net/ sudo vi /etc/apt/sources.list 32dACb http://blog.numino.net/ 删除文本所有内容,添加: j25oa8 http://blog.numino.net/ 1 UfN46m http://blog.numino.net/ 2 UP1RIx http://blog.numino.net/ 3 3x63Ao http://blog.numino.net/ 4 hB0zq0 http://blog.numino.net/ 5 2YX5l9 http://blog.numino.net/ 6 EQewNT http://blog.numino.net/ 7 RtIC89 http://blog.numino.net/ 8 bbppFq http://blog.numino.net/ 9 Mzt0cY http://blog.numino.net/ # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 q4FfwP http://blog.numino.net/ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise main restricted universe multiverse cSSiMi http://blog.numino.net/ # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise main restricted universe multiverse SO8d62 http://blog.numino.net/ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main restricted universe multiverse jgn2JB http://blog.numino.net/ # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main restricted universe multiverse L1iJUF http://blog.numino.net/ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main restricted universe multiverse 8tesCy http://blog.numino.net/ # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main restricted universe multiverse qVw5Zq http://blog.numino.net/ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-security main restricted universe multiverse liQ7l2 http://blog.numino.net/ # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-security main restricted universe multiverse shv26Z http://blog.numino.net/ 修改一下vim打开文件的编码方式,否则后续编辑有可能显示乱码 pegWLI http://blog.numino.net/ vim ~/.vimrc f6E904 http://blog.numino.net/ set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 SkoP7q http://blog.numino.net/ 安装 sudo ./php_apache.sh 安装合适的 php, apache, mysql 等依赖库 4n1hG0 http://blog.numino.net/ php_apache.sh 的内容: oYpZYu http://blog.numino.net/ apt-get update && s41Sse http://blog.numino.net/ apt-get install -y zlib1g-dev && F0AVkN http://blog.numino.net/ apt-get install -y autoconf && T0tBjU http://blog.numino.net/ apt-get install -y automake && 69I7wP http://blog.numino.net/ apt-get install -y libtool && 4rPJG2 http://blog.numino.net/ apt-get install -y libgmp3c2 && FB8CGQ http://blog.numino.net/ apt-get install -y libgmp3-dev && k71VYa http://blog.numino.net/ apt-get install -y openssl && OVi6Ur http://blog.numino.net/ apt-get install -y apache2 && l7Z9KS http://blog.numino.net/ apt-get install -y libapache2-mod-php5 && kRafqi http://blog.numino.net/ apt-get install -y php5-dev && HK014v http://blog.numino.net/ apt-get install -y php5-gd && V2a4Ld http://blog.numino.net/ apt-get install -y bison && I6OBj2 http://blog.numino.net/ apt-get install -y byacc && Sork9s http://blog.numino.net/ apt-get install -y tree && 5PGBbP http://blog.numino.net/ apt-get install -y libcurl4-openssl-dev && 7c2xkv http://blog.numino.net/ apt-get install -y dos2unix && f0paTP http://blog.numino.net/ apt-get install -y libpcre3 && ivxP6M http://blog.numino.net/ apt-get install -y libpcre3-dev && 1xbxWQ http://blog.numino.net/ apt-get install -y libmysqlclient-dev && ICxKDY http://blog.numino.net/ apt-get install -y php5-mysql && 9C4CNa http://blog.numino.net/ apt-get install -y sendmail && M23umu http://blog.numino.net/ apt-get install -y php-pear && 8pbd0n http://blog.numino.net/ apt-get install -y sqlite3 && hSviXJ http://blog.numino.net/ apt-get install -y libsqlite3-dev && NPezrT http://blog.numino.net/ apt-get install -y git && 6xCvLm http://blog.numino.net/ apt-get install -y mysql-client && fmQfC4 http://blog.numino.net/ apt-get install -y mysql-server && 58BA7c http://blog.numino.net/ apt-get install -y curl && MGCTIG http://blog.numino.net/ apt-get install -y libboost-dev && 6ppzBy http://blog.numino.net/ apt-get install -y libboost-test-dev && spt4DZ http://blog.numino.net/ apt-get install -y libboost-program-options-dev && 765Ppt http://blog.numino.net/ apt-get install -y libboost-system-dev && C50w9X http://blog.numino.net/ apt-get install -y libboost-filesystem-dev && Bo1pxN http://blog.numino.net/ apt-get install -y libevent-dev && 4lyADP http://blog.numino.net/ apt-get install -y pkg-config && dU2go3 http://blog.numino.net/ apt-get install -y g++ && Nu60cl http://blog.numino.net/ apt-get install -y libglib2.0-dev && 13rPrG http://blog.numino.net/ apt-get install -y libgtk2.0-dev && LbLzGZ http://blog.numino.net/ #apt-get install -y librdkafka-dev librdkafka1 && G2663L http://blog.numino.net/ apt-get install -y python-dev && OIR7P5 http://blog.numino.net/ apt-get install -y openjdk-7-jre openjdk-7-jdk hR8xrC http://blog.numino.net/ 安装过程提示输入mysql密码,设置的是beautiful,如设置别的密码,后续使用mysql相应修改 38Nx4x http://blog.numino.net/ 拷贝一些头文件,编译kbs会用到 s0D0i5 http://blog.numino.net/ sudo cp /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /usr/include/ Tqv8rl http://blog.numino.net/ sudo cp /usr/lib/jvm/java-7-openjdk-amd64/include/* /usr/include/ -a dWi65M http://blog.numino.net/ sudo cp /usr/lib/jvm/java-7-openjdk-amd64/include/linux/* /usr/include/ -a B77mVt http://blog.numino.net/ thirft使用 thrift-0.10.0.tar.gz (version 0.11.0/0.12.0在ubuntu12.04未能编译通过) i80a77 http://blog.numino.net/ kafka使用 librdkafka-1.0.1.tar.gz (低版本有函数未定义) 27yoXz http://blog.numino.net/ 两者编译安装 h07KlU http://blog.numino.net/ ./configure –prefix=/usr && make && sudo make install 5CvRF7 http://blog.numino.net/ 安装kbs bK961V http://blog.numino.net/ 解压kbs到/home/bbs/src目录 f41kFX http://blog.numino.net/ src/Makefile.am 2AlzIJ http://blog.numino.net/ local_utl/Makefile.am 5n3byA http://blog.numino.net/ daemon/Makefile.am oenyih http://blog.numino.net/ libBBS/Makefile.am 22fyct http://blog.numino.net/ 几个文件的 LDADD 增加 -lrdkafka 9xOiR8 http://blog.numino.net/ ./autogen.sh Hz6l99 http://blog.numino.net/ ./configure –prefix=/home/bbs –enable-site=newsmth –with-php –with-mysql TBYg6h http://blog.numino.net/ vi /etc/passwd, 找bbs的userid, grpid, 我这里是1000,1000, 更新到 site/newsmth.h 的 BBSUID, BBSGID NlxV8e http://blog.numino.net/ site.h, src/extra.h 中暂时去掉以下KBS宏定义 (暂未编译通过) pUQs95 http://blog.numino.net/ //#define ENABLE_LIKE 1 gJ6UGB http://blog.numino.net/ //#define ENABLE_REFER_LIKE xCqO4X http://blog.numino.net/ src/bbs.c 屏蔽函数 recommend_tg ExaLvy http://blog.numino.net/ src/talk.c 屏蔽函数 display_user_summary display_userinfo 1gWzeP http://blog.numino.net/ libBBS/libbm.c 屏蔽函数 AO_int_fetch_and_add 30sDw5 http://blog.numino.net/ libBBS/extra.c 屏蔽函数 AO_int_fetch_and_add AMH7eX http://blog.numino.net/ local_utl/awardonline.c 屏蔽函数 AO_int_fetch_and_add gSIARQ http://blog.numino.net/ 修改php模块待安装目录的权限 o70ekM http://blog.numino.net/ sudo chown bbs:bbs /usr/lib/php5 -R zO1v4b http://blog.numino.net/ make W9Zv5z http://blog.numino.net/ make install 9H6tAr http://blog.numino.net/ make install-home
|
|