How to Install Review Board on CentOS 7
Review Board is a free and open source tool for reviewing source code, documentation, images and many more. It is web-based software written in Python and uses either SQLite, MySQL, or PostgreSQL to store its data.
In this tutorial we will install the latest version of Review Board on CentOS 7.
Prerequisites
- A CentOS 7 x64 server instance.
- A Domain name pointed at your server.
- A Sudo User.
Step 1: Update the System
Before installing Review Board, it is recommend that you update your OS packages and reboot the server using the following commands:
sudo yum -y install epel-release
sudo yum -y update
sudo shutdown -r now
Once the system is started again, log back in as the sudo user and proceed to the following steps.
Step 2: Install Review Board
Installation of Review Board is pretty straightforward:
sudo yum -y install ReviewBoard memcached
Step 3: Configuring Database
The Review Board installation also installs Apache web server, but not any database server. While Review Board can use either SQLite, MySQL, or PostgreSQL to store it's data. We will be using MySQL/ MariaDB for the purpose of this tutorial. To install MariaDB, run the following command.
sudo yum -y install mariadb mariadb-server
Now edit the default MariaDB configuration 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
Once MariaDB is installed, run the following command to start MariaDB and enable it to automatically start at boot time using following commands.
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Now secure your MariaDB installation using the following command.
sudo mysql_secure_installation
You will be asked for current root password. As we have just install MariaDB, root password is not set. Press Enter key to proceed. Set a strong root password for your MySQL server and answer Y
for all the other questions asked. All the questions asked are self explanatory.
Once your MySQL/MariaDB server's security is hardened, proceed further to create a database to store Review Board data.
Step 4: Create Database for Review Board
Login to MySQL shell as root user using the following command.
mysql -u root -p
Provide the password for root user you just set earlier.
Now run the following queries to create the database and database user for Review Board installation.
CREATE DATABASE rb_data;
CREATE USER 'rb_user'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON rb_data.* TO 'rb_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Make sure that you use semicolon at the end of each query above. You can replace the database name rb_data
and database username rb_user
according to your need. Be sure to change StrongPassword
with a very strong password.
Step 5: Creating Review Board Site
You can now create a Review Board site. Run the following command to create a new Review Board site.
sudo rb-site install /var/www/reviews.example.net
In above command, change the path to your site according to your actual domain. During the installation it will ask you for few parameters which are as follows.
Domain Name: reviews.example.net #Your actual domain
Root Path [/]: #Press enter to use default
Database Type: 1 #Enter 1 for MySQL
Database Name [reviewboard]: rb_data #Your database name
Database Server [localhost]: #Press enter to use default
Database Username: rb_user #Your database username
Database Password: #Your database password
Memcache Server [localhost:11211]: #Press enter to use default
Username [admin]: #Provide Administrator account username
Password: #Provide Administrator account password
E-Mail Address: #Provide Administrator email
Now set the ownership of the Review Board files to the Apache user using the following command.
sudo chown -R apache:apache /var/www/reviews.example.net
Next, create a symbolic link for the Apache configuration file using the following command.
sudo ln -s /var/www/reviews.example.net/conf/apache-wsgi.conf /etc/httpd/conf.d/reviews.example.net.conf
Now start Memcached and Apache services and enable them to start at boot time using following commands.
sudo systemctl start memcached.service
sudo systemctl enable memcached.service
sudo systemctl start httpd.service
sudo systemctl enable httpd.service
You may also need to allow HTTP traffic on port 80
through the firewall if you are running one. Run the following commands for same.
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload
To avoid SELinux errors, run the following commands.
sudo setsebool -P httpd_can_sendmail 1
sudo setsebool -P httpd_can_network_memcache 1
sudo setsebool -P httpd_can_network_connect_db 1
sudo setsebool -P httpd_unified 1
You can now browse to http://reviews.example.net
to access the Review Board Site. Installation of Review Board is now finished.