在Centos上安装代码评审工具ReviewBoard的相关支持插件点滴(第二篇)

本文详细介绍了如何配置数据库和安装ReviewBoard的过程,包括设置编码集、创建数据库、使用root账号进行替换、安装RB-siteinstall命令及应用服务器配置等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

因为这个codereview的数据是要安装到数据库中,所以先要配置数据库:

1 设置编码集
[client] default-character-set=utf8 

上面这段红色,亲测非必须
[mysqld] character-set-server=utf8

2 创建数据库

$ mysql -u root -p mysql> CREATE DATABASE reviewboard CHARACTER SET utf8; mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; mysql> GRANT ALL PRIVILEGES ON reviewboard.* to 'myuser'@'localhost';
个人建议,就使用root账号进行替换

开始安装:
rb-site install /var/www/reviews.example.com
里面会有一系列配置,能用默认的就不要修改,尽量选推荐的。注意两点,数据库连接提示的时候,请填127.0.1.1,默认是localhost,另外就就是应用服务器选中apache 

应用服务器配置:
找到httpd.conf,在最后面追加这样一段
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><VirtualHost *:80>
        ServerName demo.codereview.com
        DocumentRoot "/var/www/reviews.example.com/htdocs"
        # Error handlers
        ErrorDocument 500 /errordocs/500.html
        WSGIPassAuthorization On
        WSGIScriptAlias "/" "/var/www/reviews.example.com/htdocs/reviewboard.wsgi/"
        <Directory "/var/www/reviews.example.com/htdocs">
                AllowOverride All
                Options -Indexes +FollowSymLinks
                Allow from all
        </Directory>
        # Prevent the server from processing or allowing the rendering of
        # certain file types.
        <Location "/media/uploaded">
                SetHandler None
                Options None
                AddType text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp
                AddType text/plain .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb
                <IfModule mod_php5.c>
                        php_flag engine off
                </IfModule>
        </Location>
        # Alias static media requests to filesystem
        Alias /media "/var/www/reviews.example.com/htdocs/media"
        Alias /static "/var/www/reviews.example.com/htdocs/static"
        Alias /errordocs "/var/www/reviews.example.com/htdocs/errordocs"
        Alias /favicon.ico "/var/www/reviews.example.com/htdocs/static/rb/images/favicon.png"
</VirtualHost>

完了之后,重启apache service httpd restart
有可能还会提未文件权限访问问题,不要怕,跟据提示,执行一下就OK了。基本就是开放apache去读写 reviews.exaple.com下面的数据。大功告成。
参考的官网地址:https://www.reviewboard.org/docs/manual/2.0/admin/installation/linux/

https://www.reviewboard.org/docs/manual/2.0/admin/installation/creating-sites/#creating-sites

 

https://www.reviewboard.org/docs/manual/2.0/admin/installation/linux/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值