ReviewBoard on ubuntu 12 Server --- Installation

来源:互联网 发布:淘宝刷单赚钱 编辑:程序博客网 时间:2024/05/16 01:14

1. Setting up compiling evironment 

I'm not sure, seems these steps aren't related with Review board, I use these to install Vmware tools on the Ubuntu Server.

sudo apt-get install gcc (Actually, it's  needless. Just for a record.)

sudo atp-get install build-essential (gcc is dependency of build-essential)

2. Setting up easy_install

sudo apt-get install python-setuptools

sudo apt-get install python-dev

3. Setting up a Server

I chose to use Apache2 with mod_python, as advised by the Review Board team. Apparently there are some issues with running it as fastcgi. To get an apache install capable of serving python pages:

sudo apt-get install apache2sudo apt-get install libapache2-mod-pythonsudo a2enmod python

4. Setting up storage

First we need to get MySQL and the python bindings for MySQL

sudo apt-get install mysql-server
sudo apt-get install python-mysqldb
For faster responses, we are going to install memcache and its python bindings.
sudo apt-get install memcached
#if 0// I don't follow the steps.
sudo apt-get install memcached-dev
sudo apt-get install python-memcache#else
// This steps is recommend by admin guid of Reivewboard.
sudo apt-get install libmemcache-dev
sudo easy_install http://gijsbert.org/downloads/cmemcache/cmemcache-0.95.tar.bz2
#endif
 
You will need to create a database and a database user for Review Board using the following. 
mysql -uroot -pmysql> 
中文显示乱码的解决:

创建数据库、数据库用户for ReviewBoard(这块要注意数据库的字符集设置,默认不是UTF-8)     前几次的安装都没有之一字符集的问题,导致网页上中文显示乱码。按照默认的步骤安装和配置后,输入和保存英文均没有问题,但是一旦输入中文,保存后页面显示的都是乱      码,甚至某些时候在保存中文数据时Review Board还提示错误。我的Ubuntu的locale是"zh_CN.UTF-8",输入法输      入后的中文内码应该是UTF-8。Review Board本身按理来说其    内核也应该是内置支持的UTF-8编码的,问题出在哪呢?答案是MySQL     在命令行模式进入MySQL,敲入status命令:

Server characterset:    latin1

Db    characterset:    latin1

Client characterset:    latin1

Conn.  characterset:    latin1     修改MySQL默认字符集的方法很简单,先停止MySQL Server(sudo /etc/init.d/mysqlstop),

之后打开/etc/mysql/my.cnf,分别在[client]和[mysqld]两个section下,   

增加一个key-    value(这个方法会导致mysql不能重启)     正确的做法是:     找到[client] 添加:    default-character-set=utf8 //默认字符集为utf8      找到[mysqld] 添加:      //默认字符集为utf8      default-character-set=utf8      //设定连接mysql数据库时使用utf8编码,以让mysql数据库为utf8运行  

    init_connect='SET NAMES utf8'      可是我根据这样修改后启动mysql服务报错,启动不了      在网上试了多种解决办法,都没有解决,      最后找到一个方法,可以解决,如下:      其他的还跟上面一样,只有在[mysqld]下面添加的      default-character-set=utf8      改为      character-set-server = utf8      重新启动mysql,启动成功      查看下结果是:Server characterset:    utf8                                Db    characterset:    utf8                                Client characterset:    utf8                                Conn.  characterset:    utf8,代表测试成功。 

create database reviewboard;Query OK, 1 row affected (0.00 sec)
mysql> create user 'reviewboard'@'localhost' identified by 'reviewboard';Query OK, 0 rows affected (0.00 sec)  //第二个reviewboard是密码
mysql> grant all on reviewboard.* to 'reviewobard'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Notice: there is ";“ followed by each command sentence.
【我在建数据库时又加了utf8]

>create database reviewboard defaultcharset utf8 collate utf8_general_ci;

 

>GRANT ALL PRIVILEGES ON reviewboard.*TO 'reviewboard'@'127.0.0.1' identified by 'reviewboard';

5. Setting up Subversion

Review Board requires a Subversion client and python bindings, as well as the patch tool.

sudo apt-get install patch
sudo apt-get install subversion
sudo apt-get install python-svn

6. Getting Review Board

Review Board is installed using easy_install . If you don't already have setup tools installed you will need to install it first.

sudo easy_install reviewboard

7. Creating your site

In this tutorial I am assuming that you are creating a dedicated server for Review Board. This means that Review Board will be default site. Installing as a subdomain is readily supported but I have not tested it.

Start the site creator with:

sudo rb-site install /var/www/reviewboard
To serve Review Board as the root site, use the following settings:
  • Domain = localhost
  • Root Path = /
  • Media URL = media/
  • Database Type = mysql
  • Database Name = reviewboard
  • Database server = localhost
  • Database username = 'rb'
  • Database password: 'rb_password' or whatever you used earlier in step 4
  • Cache Type = memcache
  • Memcache Server = memcached://localhost:11211/ (This should be the default)
  • Webserver = apache
  • Python loader = modpython
  • Admin account - enter your details here

Then wait for all the little green ticks to appear.

6. Configuring your site

First you need to allow the apache server to manage the uploads directory with:

sudo chown -R www-data /var/www/reviewboard/htdocs/media/uploads
Then you need to copy the site configuration into apache and enable.We are also going to disable the default site and then restart theapache server.
sudo cp /var/www/reviewboard/conf/apache-modpython.conf /etc/apache2/sites-available/reviewboard
sudo a2dissite default
sudo a2ensite reviewboard
sudo /etc/init.d/apache2 restart

7. Installing PyLucene

This is an optional step.

We use PyLucene for our search functionality. It can be complicated to install, and requires a working Java installation.

$ sudo apt-get install pylucene

【Invalid command 'WSGIPassAuthorization'

【Fix]

apt-get install libapache2-mod-wsgi

a2enmod wsgi


0 0
原创粉丝点击