Install Review Board on Ubuntu 20.04

Updated on November 21, 2023
Install Review Board on Ubuntu 20.04 header image

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

  1. Connect to your server as a non-root sudo user via SSH.

  2. Update the package information index and upgrade the packages.

     $ sudo apt update && sudo apt dist-upgrade
  3. 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 than mod_python or CGI.

     $ sudo apt install -y libapache2-mod-wsgi
  4. 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.

  1. 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
  2. When prompted, enter your MySQL server root password and hit Enter to proceed.

  3. 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;
  4. Create a dedicated review_board_user user for the review_board database. You'll provide this user's credentials when creating your first Review Board site. For security purposes, replace EXAMPLE_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';
  5. 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.

  1. Use Linux curl command to download pip.

     $ sudo curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
  2. Run the get-pip.py file that you've just downloaded to complete the setup.

     $ sudo python2 get-pip.py
  3. Upgrade the pip application.

     $ sudo pip install -U pip
  4. Install setuptools, which is a collection of enhancements that supports easy building and distribution of Python packages.

     $ sudo pip install -U setuptools

Install ReviewBoard

  1. Install the Review Board web application.

     $ sudo pip install -U ReviewBoard
  2. 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

  1. The rb-site tool is bundled with the ReviewBoard package. Use it to install and manage sites on your server. To create your first site, run the command below and replace example.com with your domain name.

     $ sudo rb-site install /var/www/example.com
  2. 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
  3. For the root path, press Enter to leave it to the default value /.

     Root Path [/]: :key_enter:
  4. 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:
  5. 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
  6. 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:
  7. 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
  8. 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
  9. 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:
  10. 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
  11. 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
  12. Enter the email address for the administrator account, such as info@example.com.

     E-Mail Address: info@example.com
  13. Enter the name of your company, such as EXAMPLE COMPANY.

     Company/Organization Name (optional): EXAMPLE COMPANY
  14. 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

  1. 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's www-data user.

     $ sudo chown -R www-data:www-data /var/www/example.com
  2. 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
  3. 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
  4. 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.