Install Review Board on Ubuntu 20.04
Review Board is an open-source web-based tool that allows you to review code quickly when working on a development project. It's free for personal and commercial use and trusted by thousands of companies, including LinkedIn, Mozilla, Yelp, and Apache Software Foundation. Review Board saves time because it allows you to review almost anything during a development lifecycle, including documentation, website designs, artwork, user interface mockups, release announcements, and feature specifications. With rich features such as syntax highlighting for over 300 languages, smarter indentation, and moved code detection, Review Board is excellent for tracking projects and fixing bugs.
In this guide, you'll install Review Board on Ubuntu 20.04 server.
Prerequisites
To complete this guide, you need to have the following:
- A Vultr Ubuntu 20.04 server instance, with a sudo user and a LAMP Stack. Because Review Board is written in Python, you may skip the PHP installation unless you're running another web application that requires PHP.
- A Fully Qualified Domain Name, such as
example.com
, that resolves to the IP address of the server.
Install the Review Board Dependencies
Connect to your server as a non-root sudo user via SSH.
Update the package information index and upgrade the packages.
$ sudo apt update && sudo apt dist-upgrade
Install the
mod_wsgi
library, a Web Server Gateway Interface module that links applications written in Python to the Apache webserver and offers better performance thanmod_python
orCGI
.$ sudo apt install -y libapache2-mod-wsgi
Install Review Board dependencies.
$ sudo apt install -y build-essential python-dev libffi-dev libssl-dev patch python-setuptools libjpeg-dev memcached libmysqlclient-dev
Create a Review Board Database
MySQL offers excellent performance to the Review Board application. It can handle large loads and concurrent users compared to a database like SQLite, which only works in a test environment.
To create a database that you'll later link to the Review Board application, log in to your MySQL server as root.
$ sudo mysql -u root -p
When prompted, enter your MySQL server root password and hit Enter to proceed.
Create a
review_board
database and set UTF-8 as the default encoding for text by running the below command.mysql> CREATE DATABASE review_board CHARACTER SET utf8;
Create a dedicated
review_board_user
user for thereview_board
database. You'll provide this user's credentials when creating your first Review Board site. For security purposes, replaceEXAMPLE_PASSWORD
with a strong value.If you use MySQL:
mysql> CREATE USER 'review_board_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'EXAMPLE_PASSWORD'; GRANT ALL PRIVILEGES ON review_board.* TO 'review_board_user'@'localhost'; FLUSH PRIVILEGES;
If you use MariaDB:
MariaDB> GRANT ALL PRIVILEGES on review_board.* TO 'review_board_user'@'localhost' identified by 'EXAMPLE_PASSWORD';
Log out from the MySQL command-line interface.
mysql> EXIT;
Install Python Package Installer and Setuptools
The pip
tool manages Python packages and modules. You'll use it to download and install additional modules and the Review Board application.
Use Linux
curl
command to downloadpip
.$ sudo curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
Run the
get-pip.py
file that you've just downloaded to complete the setup.$ sudo python2 get-pip.py
Upgrade the
pip
application.$ sudo pip install -U pip
Install
setuptools
, which is a collection of enhancements that supports easy building and distribution of Python packages.$ sudo pip install -U setuptools
Install ReviewBoard
Install the Review Board web application.
$ sudo pip install -U ReviewBoard
For the Review Board application to connect to the MySQL database you created earlier, install the
mysqlclient
package.$ sudo pip install mysqlclient
Create a New Review Board Site
The
rb-site
tool is bundled with theReviewBoard
package. Use it to install and manage sites on your server. To create your first site, run the command below and replaceexample.com
with your domain name.$ sudo rb-site install /var/www/example.com
When prompted, enter a domain name e.g.
example.com
.* What's the host name for this site? This should be the fully-qualified host name without the http://, port or path. Domain Name: example.com
For the root path, press Enter to leave it to the default value
/
.Root Path [/]: :key_enter:
Press 1 to choose MySQL as the database type.
* 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: :key_1:
Enter
review_board
as the name of the database and press Enter.* 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]: review_board
Press Enter to leave localhost as the default MySQL server.
* 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]: :key_enter:
For the database username, enter
review_board_user
.* 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: review_board_user
Enter the password that you provided when creating your database user in place of
EXAMPLE_PASSWORD
.Database Password: EXAMPLE_PASSWORD
Confirm the database password.
Confirm Database Password: EXAMPLE_PASSWORD
Press Enter to leave
localhost:11211
as the default host and port for the Memcached server.* What memcached host should be used? This is in the format of hostname:port The default is localhost:11211 Memcache Server [localhost:11211]: :key_enter:
Create a Review Board administrator account, for example:
admin
.* 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]: admin
Enter a password for the administrator account that you've just created. Choose a strong password to replace
EXAMPLE_PASSWORD
.Password: EXAMPLE_PASSWORD
Confirm the password for the administrator account.
Confirm Password: EXAMPLE_PASSWORD
Enter the email address for the administrator account, such as info@example.com.
E-Mail Address: info@example.com
Enter the name of your company, such as EXAMPLE COMPANY.
Company/Organization Name (optional): EXAMPLE COMPANY
Opt to either allow Review Board to collect data for better support by either entering Y or N
Allow us to collect support data? [Y/n]: :key_y:
After answering all the above questions, your Review Board site should be installed within a few seconds.
Post-install Configuration
Review Board needs access to some directories, so assign the ownership of the
/var/www/example.com
directory and all child directories under it to the Apache'swww-data
user.$ sudo chown -R www-data:www-data /var/www/example.com
Copy the
/var/www/example.com/conf/apache-wsgi.conf
configuration file to the Apache's/etc/apache2/sites-available/
directory.$ sudo cp /var/www/example.com/conf/apache-wsgi.conf /etc/apache2/sites-available/example.com.conf
To enable the site, copy its configuration file to the Apache's
/etc/apache2/sites-enabled
directory.$ sudo ln -s /etc/apache2/sites-available/example.com.conf /etc/apache2/sites-enabled/example.com.conf
Restart the Apache web server for the changes to take effect.
$ sudo systemctl restart apache2
Test the Review Board Site
In your web browser, visit your server's domain name. For example,
http://example.com
You should now see the front end of your Review Board site.
Conclusion
You've successfully installed Review Board on Ubuntu 20.04 server. Use this intuitive code review tool when working on your next development project to track and fix bugs. The official documentation is available at the main Review Board site.