Apache+SVN+Review Board代码审核服务器搭建流程
一、简介
代码审查(CodeReview)不但可以提高质量,而且还是一个知识共享和指导的极好的手段。ReviewBoard是一款比较优秀的,开源的基于WEB的代码审查工具。
二、准备工作
2.1、安装依赖包
yum -y install gcc gcc-c++ make cmake autoconfautomake libffi libffi-devel ncurses* bison* zlib* expat* openssl* apr* neon*
2.2、安装Apache
yum -y install httpd httpd-devel
2.3、安装MySQL
yum -y install mysql mysql-server mysql-devel mysql-python service mysqld start
登录MySQL创建reviewboard数据库和reviewboard用户
mysql –uroot –p >create database reviewboard default charset utf8collate utf8_general_ci; >grant all on reviewboard.* to'reviewboard'@'localhost' identified by 'reviewboard';
2.4、安装memcached
yum -y install memcached python-memcached service memcached start
2.5、安装patch
yum -y install patch
2.6、安装Python
yum -y install python python-devel
2.7、安装python-subvertpy pysvn
如果python版本为2.6(CentOS6.x),可以采用EPEL yum源进行下载
(1)、 rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum -y installpython-subvertpy pysvn
(安装yum源EPEL红帽企业库,centos默认yum源库中没有pysvn)
(2)、 yum --enablerepo=epel install pysvnpython-subvertpy
(指定在EPEL yum源中,下载pysvn,python-subvertpy)
CentOS7.x 安装EPEL源
rpm -ivhhttp://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
3.1、安装easy_install
distribute从0.7版本后就和setuptools合并在一起了,所以先删除旧版(setuptools)easy_install。
第一步:删除easy_install
rm -f /usr/bin/easy_install* rm -f /usr/local/bin/easy_install*
第二步:安装distribute
wget https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py python distribute_setup.py rm distribute_setup.py
3.2、安装ReviewBoard
easy_install reviewboard rb-site install /var/www/html/reviewboard
根据情况配置以下内容
Domain Name: 192.168.2.41 Root Path [/]: Database Type: mysql Database Name [reviewboard]: Database Server [localhost]: Database Username: reviewboard Database Password: Confirm Database Password: Memcache Server [localhost:11211]: Username [admin]: admin Password: Confirm Password: E-Mail Address: public@unilifemedia.com Company/Organization Name (optional): unilifemedia Allow us to collect support data? [Y/n]:
3.3、配置reviewboard目录权限
chown -R apache.apache/var/www/html/reviewboard/htdocs/ chown -R apache.apache /var/www/html/reviewboard/data
3.4、配置reviewboard
把apache-wsgi.conf配置文件放到Apache的conf.d目录下
cp /var/www/html/reviewboard/conf/apache-wsgi.conf/etc/httpd/conf.d/
配置允许访问reviewboard的域名或IP
vi/var/www/html/reviewboard/conf/settings_local.py
ALLOWED_HOSTS =['192.168.2.41','codereviewboard.unilifemedia.com']
重启Apache
service httpd restart
输入刚才配置的admin密码
4.1、进入管理员后台
4.2、配置发送邮件
4.3、配置审核代码仓库
输入名称,SVN仓库地址,用户名密码。
4.4、添加用户