How to install Review Board on a CentOS 7 VPS

how-to-install-review-board-on-a-centos-7-vpsIn this tutorial we are going to explain how to install Review Board on a CentOS 7 Linux VPS.

What is Review Board?

It is a code review system that saves you time, money and sanity so you can focus on making better software. It can easily track team’s review requests, it has a great diff viewer, it supports uploading and reviewing of all kinds of files, it has nice commenting system and much more.

Requirements?

  • CentOS 7 Linux VPS Hosting
  • Web server
  • Database server
  • Python 2.5+
  • Memcached

1. UPDATE SYSTEM

Before going any further, ssh to your CentOS VPS, initiate a screen session and upgrade your system using yum:

## screen -U -S review-board
## yum update

2. INSTALL MARIADB (MYSQL)

Review Board supports MySQL/MariDB version 5.0.31 or newer, PostgreSQL or Sqlite3 as a database server. In our case we are going to use MariaDB which is the default database server in CentOS 7 and it’s a drop-in replacement for MySQL. Let’s install MariaDB using yum:

## yum install mariadb mariadb-server mysql

Once installed, add bind-address = 127.0.0.1 to /etc/my.cnf.d/server.cnf to bind MariaDB to localhost only:

## vim /etc/my.cnf.d/server.cnf

[mysqld]
#log-bin=mysql-bin
#binlog_format=mixed
bind-address = 127.0.0.1

Restart the MariaDB database server and enable it to start on system start-up using:

## systemctl restart mariadb
## systemctl status mariadb
## systemctl enable mariadb

Optionally, you can run the mysql_secure_installation post-installation script to finish the MariaDB set-up.

## mysql_secure_installation

Enter current password for root (enter for none): ENTER
Set root password? [Y/n] Y
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

3. INSTALL APACHE

Review Board can run on Lighttp + fastcgi or Apache + mod_python, Apache + fastcgi, Apache + mod_wsgi. We will be using Apache + mod_wgsi, so let’s install Apache and mod_wsgi on the CentOS VPS system using yum

## yum install httpd openssl mod_ssl mod_wsgi

Restart Apache and add it to automatically start on your system start-up using:

## systemctl restart httpd
## systemctl status httpd
## systemctl enable httpd

Optionally, configure some extra Apache options, for example, hide its version number, its banner etc… by adding the following to /etc/httpd/conf.d/options.conf

## vim /etc/httpd/conf.d/options.conf

TraceEnable off

## Disable Signature
ServerSignature Off

## Disable Banner
ServerTokens Prod

Test Apache configuration file and restart the webserver for the changes to take effect:

## apachectl configtest
## systemctl restart httpd
## systemctl status httpd

SETUP REVIEW BOARD

The Review Board in CentOS 7 is provided by the EPEL repository. So, in order to install the package you have to enable EPEL on your Linux VPS.

4. ENABLE EPEL REPOSITORY

You can easily enable EPEL in CentOS 7 using yum as in:

## yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm

Verify that EPEL has been enabled on your Linux VPS Hosting by running the following command:

## yum repolist

 5. INSTALL REVIEW BOARD

Once EPEL has been added to your server, you can install Review Board and its dependencies by running:

## yum install ReviewBoard

6. INSTALL MEMCACHED

Memcached is a high-performance caching server used by Review Board. While optional, it’s strongly recommended in order to have a fast, responsive server. Along with memcached, we need the python-memcached Python bindings.

## yum install memcached python-memcached.noarch

start memcached using:

## systemctl restart memcached
## systemctl enable memcached

Edit the memcached configuration file, locate the value for OPTIONS and change it to localhost or 127.0.0.1:

vi /etc/sysconfig/memcached
OPTIONS="-l 127.0.0.1"

7. INSTALL SOURCE CONTROL APPS

Depending on which source control systems you plan to use, you will need some additional components like cvs, git, mercurial etc..

## yum install cvs git subversion python-subvertpy

8. CREATE REVIEW BOARD SITE

Once Review Board is installed, a site must be created. Each site maps to a domain, subdomain, or directory installation. To create a site, you will use the rb-site install command. We are going to use reviews.domain.com for our Review Board site and it will be located in /var/www/html/reviews.domain.com directory.

Before you begin with the installation, let’s create a new MySQL database that we’ll be using for our Board Site.

## mysql -u root -p

MariaDB> create database reviewboard;
MariaDB> grant all on reviewboard.* to reviewboard@localhost identified by 'STRONG_PASSWORD';
\q

Begin the installation of your new site by running the following:

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
## rb-site install /var/www/html/reviews.domain.com

You will now be asked a series of questions about your site setup. It is expected that you will know the answers to these questions. If not, you’ll have to decide what software you want to use for your services and refer to their documentation on how to set them up and configure them.

for example:

Domain Name: reviews.domain.com
Root Path [/]: /
Database Type: 1
Database Name [reviewboard]: reviewboard
Database Server [localhost]: localhost
Database Username: reviewboard
Database Password: STRONG_PASSWORD
Confirm Database Password: STRONG_PASSWORD
Memcache Server [localhost:11211]: localhost:11211
Username [admin]: admin
Password: YOUR_ADMIN_PASS
Confirm Password: YOUR_ADMIN_PASS
E-Mail Address: youremail@domain.com

Next, setup correct permissions by running:

## chown -R apache: /var/www/html/reviews.domain.com

9. SETUP APACHE VHOST

Final thing to do is to setup an Apache virtual host directive that will serve our Review Board site. An example configuration file should be available in conf/apache-wsgi.conf, so copy the sample configuration file to /etc/httpd/conf.d and restart apache for the changes to take effect:

## cp /var/www/html/reviews.domain.com/conf/apache-wsgi.conf /etc/httpd/conf.d/
## apachectl configtest
## systemctl restart httpd

That’s it. Now you can access your Review Board at http://reviews.domain.com and login with your ‘admin’ username and password you set earlier.

What’s Next?


Of course you don’t have to do any of this if you use one of our CentOS Optimized Hosting services, in which case you can simply ask our expert Linux admins to install Review Board. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

5 thoughts on “How to install Review Board on a CentOS 7 VPS”

  1. Thank you for an excellent article.
    Just a note; If one after installing ReviewBoard gets an erro when accessing the site that says “Bad Request (400)”, try changing /var/www//conf/settings_local.py” ALLOWED_HOSTS = [”] to ALLOWED_HOSTS = [‘*’].

    Reply
  2. Hi, Thanks for a detailed article.
    One question what if i dont have Linux VPS Hosting Server, but only a Linux centOS 7 on Oracle Virtual Box?
    What domain name should i provide in that case: rb-site install /var/www/html/reviews.domain.com ????

    Reply
    • You can find all about it in the official documentation page on: https://www.reviewboard.org/docs/manual/latest/admin/configuration/repositories/perforce

      Reply

Leave a Comment