Charon Technology

カーロン・テクノロジでは、ソフトウェアの開発に際して、ソースコードレビューシステムReview Boardを用いることがあります。 本ページでは、Review Boardサーバの構築手順をまとめます。

パッケージインストール

はじめに、Review Boardの動作に必要となるパッケージを導入します。 まずは、APTでパッケージをインストールします。

$ sudo apt-get install lighttpd build-essential python-setuptools python-flup python-dev memcached python-imaging mysql-server python-mysqldb libmysqld-dev git-core libffi-dev libssl-dev

次に、Pythonのパッケージを導入します。

$ sudo easy_install python-memcached
$ sudo easy_install mysql-python
$ sudo easy_install reviewboard

データベース作成

Review Boardの導入では、Review Boardインストール時点でデータベースが作成されていなければいけません。

$ mysql -u root -p
mysql> CREATE DATABASE reviewboard CHARACTER SET utf8;
mysql> GRANT ALL PRIVILEGES ON reviewboard.* TO 'reviewboard'@'localhost' IDENTIFIED BY 'rpassword';
mysql> \q

Review Boardインストール

以上の準備の後、Review Boardをインストールします。 Review Boardのパッケージがインストールされた時点で、rb-siteコマンドが使用できるようになっているはずなので、これを用いてインストールします。

$ sudo rb-site install /var/www/reviewboard --web-server-type=lighttpd
インストール中、次のようにいくつかの質問があります。 Domain Nameについては、HTTPサーバの設定ファイルに反映されるため、正しく答えないと、Review Boardにアクセスできなくなります。
* Welcome to the Review Board site installation wizard

This will prepare a Review Board site installation in:

/var/www/reviewboard

We need to know a few things before we can prepare your site for
installation. This will only take a few minutes.


* Make sure you have the modules you need

Depending on your installation, you may need certain Python
modules and servers that are missing.

If you need support for any of the following, you will need to
install the necessary modules and restart the install.

Databases (optional):
* PostgreSQL (psycopg2)


* What's the host name for this site?

This should be the fully-qualified host name without the http://,
port or path.

Domain Name: 192.168.3.140


* What URL path points to Review Board?

Typically, Review Board exists at the root of a URL. For example,
http://reviews.example.com/. In this case, you would specify "/".

However, if you want to listen to, say,
http://example.com/reviews/, you can specify "/reviews/".

Note that this is the path relative to the domain and should not
include the domain name.

The default is /

Root Path [/]:


* What database type will you be using?

You can type either the name or the number from the list below.

(1) mysql
(2) sqlite3 (not supported for production use)

Database Type: 1


* What database name should Review Board use?

NOTE: You need to create this database and grant user modification
rights before continuing. See your database documentation for more
information.

The default is reviewboard

Database Name [reviewboard]:


* What is the database server's address?

This should be specified in hostname:port form. The port is
optional if you're using a standard port for the database type.

The default is localhost

Database Server [localhost]:


* What is the login and password for this database?

This must be a user that has table creation and modification
rights on the database you already specified.

Database Username: reviewboard

Database Password: rpassword

Confirm Database Password: rpassword


* What memcached host should be used?

This is in the format of hostname:port

The default is localhost:11211

Memcache Server [localhost:11211]:


* Create an administrator account

To configure Review Board, you'll need an administrator account.
It is advised to have one administrator and then use that account
to grant administrator permissions to your personal user account.

If you plan to use NIS or LDAP, use an account name other than
your NIS/LDAP account so as to prevent conflicts.

The default is admin

Username [admin]:

Password: admin

Confirm Password: admin

E-Mail Address: user@charon.tech

Company/Organization Name (optional):


* Enable collection of data for better support

We would like to periodically collect data and statistics about
your installation to provide a better support experience for you
and your users.

The data collected includes basic information such as your company
name, the version of Review Board, and the size of your install.
It does NOT include confidential data such as source code. Data
collected never leaves our server and is never given to any third
parties for any purposes.

We use this to provide a user support page that's more specific to
your server. We also use it to determine which versions to
continue to support, and to help track how upgrades affect our
number of bug reports and support incidents.

You can choose to turn this off at any time in Support Settings in
Review Board.

Allow us to collect support data? [Y/n]: n

インストール後、reviewboardディレクトリの所有者をwww-dataに変更します。

$ sudo chown -R www-data:www-data /var/www/reviewboard

HTTPサーバの設定

Lighttpdの設定を変更し、インストールしたReview Boardにアクセスできるようにします。

$ sudo vi /etc/lighttpd/lighttpd.conf
/etc/lighttpd/lighttpd.conf
include "/var/www/reviewboard/conf/lighttpd.conf"

設定ファイルの修正後、Lighttpdを再起動します。

$ sudo serivce lighttpd restart