How to Install Review Board on Ubuntu 16.04

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month. Get a Cloud Server

Review Board is a free and open source web-based software tool which is used to Review your developers code yet pre-commit and post-commit. It is written in Python and uses either SQLite, MySQL, MariaDB or PostgreSQL to store its data.

It scales well from small projects to large companies and offers a variety of tools to simplify code review.

You can install Review Board on any server running Apache or Lighttpd. Review Board is used by lots of companies like, Novell, Cisco, Yahoo, Linkedin, Amazon, KDE, Cloudera, NetApp, Twitter, VMware, HBase, Apache Software Foundation and much more.

Here, we will install the latest version of Review Board on Ubuntu 16.104 server.

Requirements

A server running Ubuntu 16.04.

A normal user with sudo privileges setup on your server.

Update the System

Before installing any packages, it is recommended to update your system with the latest stable version. You can do this with the following command:

sudo apt-get update -y

sudo apt-get upgrade -y

Once your system is up to date, you can proceed to install Apache web server.

Install Apache Web Server

First, you will need to install Apache web server on your system. You can easily install it by running the following command:

sudo apt-get install apache2 libapache2-mod-wsgi -y

Once apache is installed, start the Apache web server and enable it to start on boot with the following command:

sudo systemctl start apache2

sudo systemctl enable apache2

Install Required Dependencies

First, you will need to install some required dependencies, memcache and required tools on your server.

You can install them by running the following command:

sudo apt-get install python-setuptools python-dev memcached python-mysqldb patch libjpeg-dev -y

Once all of them are installed, you will need to install python package manager (pip):

sudo easy_install pip

Next, install revision control system supported by Review Board by running the following command:

sudo apt-get install cvs git-core subversion python-svn -y

Once you are done, you can proceed to the next step.

Install Review Board

Before installing Review Board, you will need to install few more dependencies so that Review Board can install.

You can install them with the following command:

sudo apt-get install python-cffi build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 zlib1g-dev libxml2-dev libxslt1-dev libssl-dev -y

Once all of them are installed, install Review Board with the following command:

sudo pip install ReviewBoard

Install and Configure MySQL

Review Board uses SQLite, MySQL or PostgreSQL to store it's data. Here, we will use MySQL. You can install MySQL with the following command:

sudo apt-get install mysql-server -y

Next, you will need to make some changes in default MySQL configuration file. You can do this by editing /etc/mysql/my.cnf file.

sudo nano /etc/mysql/my.cnf

Add the following lines:

[client] default-character-set=utf8 [mysqld] character-set-server=utf8

Save and close the file when you are finished, then start MySQL and enable it to automatically start at boot time using following commands.

sudo systemctl start mysql

sudo systemctl enable mysql`

Next, you will also need to secure your MySQL installation. You can do this by running mysql_secure_installation script:

sudo mysql_secure_installation

Answer all the questions as shown below:

Set root password? [Y/n] n Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y

Once MySQL is secured, log in to the MySQL shell and create a database for Review Board:

mysql -u root -p

Enter your root password when prompt, then create a database for Review Board. It is recommended to set secure password:

mysql>CREATE DATABASE reviewboarddb;

Query OK, 1 row affected (0.00 sec)

Next, create a username and password for Review Board with the following command:

mysql>CREATE USER 'reviewboard'@'localhost' IDENTIFIED BY 'password';

Query OK, 1 row affected (0.00 sec)

Next, grant privileges to the Review Board database with the following command:

mysql>GRANT ALL PRIVILEGES ON reviewboarddb.* TO 'reviewboard'@'localhost';

Query OK, 1 row affected (0.00 sec)

Next, you will need to run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MySQL and we can use new credential:

mysql>FLUSH PRIVILEGES;

Query OK, 1 row affected (0.00 sec)

Next, exit from the MySQL console with the following command:

mysql>\q

Once you are done, you can proceed to the next step.

Configure Review Board Site

You can easily create a new Review Board Site using the rb-site command:

sudo rb-site install /var/www/reviewboard

During the Review Board installation it will ask you following parameters:

Domain Name: yourdomain.com Root Path [/]:Press Enter Database Type: 1 #Enter 1 for MySQL Database Name [reviewboard]: reviewboard Database Server [localhost]: #Press enter to use default Database Username: reviewboard Database Password: password Memcache Server [localhost:11211]: #Press enter to use default Username [admin]: siteadmin Password: your-password E-Mail Address: hitjethva@gmail.com

Once you are done, change the ownership of the Review Board folder to the Apache user with hte following command:

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

Next, create a virtual host file for Review Board with the following command:

sudo cp /var/www/reviewboard/conf/apache-wsgi.conf /etc/apache2/sites-available/reviewboard.conf

Next, enable the virtual host with the following command:

sudo a2ensite reviewboard.conf

Finally, restart Memcached and Apache services and enable Memcached service to start at boot with the following command:

sudo systemctl restart memcached

sudo systemctl enable memcached

sudo systemctl restart apache2

Access the Review Board Site

Before accessing the Review Board web interface, you will need to allow HTTP service through UFW firewall.

By default UFW is disabled on your system, so you need to enable it first. You can enable it with the following command:

sudo ufw enable

Once UFW firewall is enabled, you can allow HTTP service by running the following command:

sudo ufw allow http

You can now check the status of UFW firewall by running the following command:

sudo ufw status

Open your web browser and type the URL http://yourdomain.com to access the Review Board Site.

Congratulations! You have successfully install Review Board on your Ubuntu 16.04 server.