Review Board is a free and open source web-based software tool that can be used for reviewing source code, documentation, images and many more. 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.
Advantages of Review Board are listed below:
- Cost and Time saving.
- Easily review Pre-commit and Post-commit code.
- Code review dramatically helps in the quality of products.
Here, we will install the latest version of Review Board on CentOS 7 server.
Requirements
- A server running CentOS 7.
- A normal user with sudo privileges setup on your server.
Getting Started
First, you will need to install EPEL repo to your system. You can install it by running the following command:
sudo yum install epel-release -y
Next, update your system with the latest stable version. You can do this by running the following command:
sudo yum update -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 and other required packages on your system. You can install it with the following command:
sudo yum install httpd openssl mod_ssl mod_wsgi
After installing Apache, start the Apache web server and enable it to start on boot with the following command:
sudo systemctl start httpd
sudo systemctl enable httpd
Once you are done, you can proceed to install and configure Database.
Install and Configure Database
Review Board uses SQLite, MySQL, MariaDB or PostgreSQL to store it’s data. Here, we will install MariaDB to store it’s data.
You can install MariaDb with the following command:
sudo yum install mariadb mariadb-server -y
Once MariaDB is installed, you will need to make some changes in my.cnf file:
Edit the my.cnf file using the following command:
sudo nano /etc/my.cnf
Add the following lines at the bottom of the file so that the server is configured to use the UTF-8 encoding for text.
[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
Next, start MariaDB service and enable it to start on boot with the following command:
sudo systemctl start mariadb
sudo systemctl enable mariadb
Next, you will need to secure your MariaDB installation. You can secure it by running the following command:
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 MariaDB is secured, login to MariaDB shell with the following command:
mysql -u root -p
Enter your root password when prompted, then create a database for Review Board with the following command:
MariaDB [(none)]>CREATE DATABASE reviewdb;
Query OK, 1 row affected (0.00 sec)
Next, create a username and password for Review Board with the following command:
MariaDB [(none)]>CREATE USER 'reviewuser'@'localhost' IDENTIFIED BY 'password';
Query OK, 1 row affected (0.00 sec)
Next, grant privileges to the Review Board database with the following command:
MariaDB [(none)]>GRANT ALL PRIVILEGES ON reviewdb.* TO 'reviewuser'@'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 MariaDB and we can use new credential:
MariaDB [(none)]>FLUSH PRIVILEGES;
Query OK, 1 row affected (0.00 sec)
Next, exit from the MariaDB console with the following command:
MariaDB [(none)]>\q
Once you are done, you can proceed to install Review Board.
Install and Configure Review Board
You can easily install Review Board with the following command;
sudo yum install ReviewBoard memcached -y
Once Review Board is installed, you will need to create a site for Review Board.
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]: reviewdb
Database Server [localhost]: #Press enter to use default
Database Username: reviewuser
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 finished, set the ownership of the Review Board files to the Apache user using the following command.
sudo chown -R apache:apache /var/www/reviewboard
Next, create a symbolic link for the Apache configuration file using the following command.
sudo ln -s /var/www/reviewboard/conf/apache-wsgi.conf /etc/httpd/conf.d/reviewboard.conf
Next, restart Apache services with the following command:
sudo systemctl restart httpd
Now start Memcached service and enable it to start at boot time using following commands.
sudo systemctl start memcached
sudo systemctl enable memcached
Access the Review Board Site
Before accessing the Review Board web interface, you will need to allow HTTP service through firewall.
You can do this by running the following command:
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload
Once you are done, open your web browser and navigate the URL http://yourdomain.com to access the Review Board Site.
Conclusion
Congratulations! you have successfully installed Review Board on CentoS 7 server. You can now easily deploy it for your developers.
Feel free to comment me if you have any questions.