ReviewBoard installation Complete Guide Ubuntu OS
Code review doesn’t have to be so hard. Review Board takes the pain out of code review, saving you time, money, and sanity. so you can focus on making great software. ReviewBoard is a software which is used to Review your developers code yet pre-commit and post-commit. Doing code review manually without any software help takes hell lot of time. ReviewBoard Installation Complete Guide Ubuntu OS Step by Step.
ReviewBoard application for commercial use also completely free, It’s developed under MIT license. Your contribution is highly recommended for ReviewBoard.
ReviewBoard installation Advantages
- Pre-Commit and Post-Commit Code Review is possible ReviewBoard installation complete Guide Ubuntu OS
- Save your time and Money
ReviewBoard installation Complete Guide Ubuntu OS
In Internet world so many installation guides are available for ReviewBaord application even ReviewBaord Website Itself is providing the steps for the installation still there are few steps we need to do additionally which are not mentioned in official site as well.
Note: Recommended to do this setup on fresh installation
Step 1 Adding ReviewBoard repository
Edit below mentioned file and add repository path
root@TechTutorials ~# vi /etc/apt/sources.list## Add below line end of above mentioned file deb http://package.perforce.com/apt/ubuntu/ trusty release
Step 2 Installing Python Setup Tools
root@TechTutorials:~# apt-get install python-setuptools ** Output Truncated ** Adding setuptools 27.2.0 to easy-install.pth file Installing easy_install script to /usr/local/bin Installing easy_install-2.7 script to /usr/local/bin Installed /usr/local/lib/python2.7/dist-packages/setuptools-27.2.0-py2.7.egg Processing dependencies for setuptools Finished processing dependencies for setuptool
Python Steup tools has been installed successfully
root@TechTutorials:~# apt-get install python-dev
Python Dev Tools Installed Successfully
Step 3 Install and Start Memcached Service
Memcached is used serve web requests faster with low memory (Hardware resource)
root@TechTutorials:~# apt-get install memcached root@TechTutorials:~# service memcached start root@TechTutorials:~# service memcached status ● memcached.service - memcached daemon Loaded: loaded (/lib/systemd/system/memcached.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2016-09-15 18:48:52 IST; 3h 4min ago Main PID: 12432 (memcached) CGroup: /system.slice/memcached.service └─12432 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1 Sep 15 18:48:52 TechTutorials systemd: Started memcached daemon. Sep 15 21:53:22 TechTutorials systemd: Started memcached daemon. root@TechTutorials:~# easy_install python-memcached ** OutPut Truncated ** Installed /usr/local/lib/python2.7/dist-packages/six-1.10.0-py2.7.egg Finished processing dependencies for python-memcached
root@TechTutorials:~# apt-get install patch ** Output Truncated ** patch is already the newest version (2.7.5-1). patch set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 151 not upgraded
Step 4 Install ReviewBoard Application
To install ReviewBoard application we have to run below command
root@TechTutorials:~# easy_install ReviewBoard ** Output Truncated ** Perhaps you should add the directory containing `libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found [Kc/_cffi_backend.c:15:17:fatal error:[Kffi.h: No such file or directory compilation terminated. error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
You may end up with above error to resolve that we have to install few more packages and run the reviewboard installation again
root@TechTutorials:~# sudo apt-get install python-cffi root@TechTutorials:~# sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-p ython2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 pyth root@TechTutorial:~# apt-get install zlib1g-dev libxml2-dev libxslt1-dev root@TechTutorials:~# apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev root@TechTutorials:~# easy_install ReviewBoard ** Output Truncated ** Running futures-3.0.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ZtGUmU/futures-3.0.5/egg-dist-tmp-gD_a04 creating /usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg Extracting futures-3.0.5-py2.7.egg to /usr/local/lib/python2.7/dist-packages Adding futures 3.0.5 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg Finished processing dependencies for ReviewBoard
If you see above finished message your ReviewBoard application is installed.
Now we have to install related dependent packages and configure ReviewBoard Site
Step 5 MySQL Server installation and Creation of Database
Install MySQL Server and create database to store the data
root@TechTutorials:~# apt-get install mysql-server
While packages are installing it will ask you to enter the root user password for MySQL server.
Step 6 Install Other Packages
Now we have to install all other supporting packages to ReviewBoard installation
root@TechTutorials:~# easy_install mysql-python root@TechTutorials:~# apt-get install python-mysqldb root@TechTutorials:~# apt-get install libmysqlclient-dev root@TechTutorials:~# easy_install mysql-python root@TechTutorials:~# easy_install psycopg2 root@TechTutorials:~# apt-get install libpq-dev root@TechTutorials:~# apt-get install cvs root@TechTutorials:~# apt-get install git-core root@TechTutorials:~# easy_install mercurial root@TechTutorials:~# apt-get install pip root@TechTutorials:~# easy_install pip
If you would like to integrate your ReviewBoard application with Perforce application then you have to install below package
root@TechTutorials: ~root@TechTutorials:~# pip install p4python Collecting p4python Downloading p4python-2016.1.1415051.tar.gz (83kB) [K 100% |████████████████████████████████| 92kB 138kB/s [?25hInstalling collected packages: p4python Running setup.py install for p4python ... [?25l- \ | / - \ | / - \ | / - \ | done [?25hSuccessfully installed p4python-2016.1.1415051 root@TechTutorials: ~root@TechTutorials:~# easy_install mercurial Searching for mercurial Best match: mercurial 3.9.1 Processing mercurial-3.9.1-py2.7-linux-x86_64.egg Adding mercurial 3.9.1 to easy-install.pth file Installing hg script to /usr/local/bin Using /usr/local/lib/python2.7/dist-packages/mercurial-3.9.1-py2.7-linux-x86_64.egg Processing dependencies for mercurial Finished processing dependencies for mercurial
Install subversion and SVN
root@TechTutorials:~# apt-get install subversion python-svn root@TechTutorials:~# apt-get install python-subvertpy root@TechTutorials:~# easy_install subvertpy Searching for subvertpy Best match: subvertpy 0.9.3 Adding subvertpy 0.9.3 to easy-install.pth file Using /usr/lib/python2.7/dist-packages Processing dependencies for subvertpy Finished processing dependencies for subvertpy root@TechTutorials:~# easy_install django-storages root@TechTutorials:~# easy_install django-storage-swift root@TechTutorials:~# easy_install nose Sphinx
Step 7 Apache Server installation and configuration
This application will work on web, so everything we can manage this application from web interface. To host this application on web interface install apache2 server.
root@TechTutorials:~# apt-get install apache* root@TechTutorials: ~root@TechTutorials:~# service apache2 restart root@TechTutorials: ~root@TechTutorials:~# service apache2 status
Apache2 server should be in running state.
Step 8 Creating Site in ReviewBoard Application
As we see in above post ReviewBoard installation, After installation we have to create site in ReviewBoard then only our application can be opened from web interface. Here is the process how to create site in ReviewBoard.
To Create site in ReviewBoard first step is to create MySQL Database and user, grant permissions to user.
Edit below MySQL config file and add few lines for application compatibility
root@TechTutorials:~# vi /etc/mysql/my.cnf
[client] default-character-set=utf8 [mysqld] character-set-server=utf8 :wq
Create Database, User and Grant Permissions ReviewBoard installation complete Guide Ubuntu OS
root@TechTutorials:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.15-0ubuntu0.16.04.1 (Ubuntu) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE reviewboard CHARACTER SET utf8; Query OK, 1 row affected (0.00 sec) mysql> CREATE USER 'rvb'@'localhost' IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON reviewboard.* to 'rvb'@'localhost'; Query OK, 0 rows affected (0.02 sec) mysql> exit Bye
Below is the command used to create the site in ReviewBoard
root@TechTutorials:~# rb-site install /var/www/html/reviewboard1 Domain Name: localhost.localdomain * What URL path points to Review Board? Typically, Review Board exists at the root of a URL. For example, http://reviews.example.com/. In this case, you would specify "/". However, if you want to listen to, say, http://example.com/reviews/, you can specify "/reviews/". Note that this is the path relative to the domain and should not include the domain name. The default is / Root Path [/]: * What database type will you be using? You can type either the name or the number from the list below. (1) mysql (2) postgresql (3) sqlite3 (not supported for production use) Database Type: 1 * 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]: * 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]: * 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: rvb Database Password: ****** Confirm Database Password: ****** * What memcached host should be used? This is in the format of hostname:port The default is localhost:11211 Memcache Server [localhost:11211]: * 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]: Password: Confirm Password: E-Mail Address: firstname.lastname@example.org Company/Organization Name (optional): * Enable collection of data for better support We would like to periodically collect data and statistics about your installation to provide a better support experience for you and your users. The data collected includes basic information such as your company name, the version of Review Board, and the size of your install. It does NOT include confidential data such as source code. Data collected never leaves our server and is never given to any third parties for any purposes. We use this to provide a user support page that's more specific to your server. We also use it to determine which versions to continue to support, and to help track how upgrades affect our number of bug reports and support incidents. You can choose to turn this off at any time in Support Settings in Review Board. Allow us to collect support data? [Y/n]: y * Installing the site... **Output Truncated ** Installing custom SQL ... Installing indexes ... Installed 0 object(s) from 0 fixture(s) OK Performing migrations ... No evolution required. OK Creating administrator account ... OK Saving site settings ... Saving site /var/www/html/reviewboard1 to the sitelist /etc/reviewboard/sites OK Setting up support ... OK * The site has been installed The site has been installed in /var/www/html/reviewboard1 Sample configuration files for web servers and cron are available in the conf/ directory. You need to modify the ownership of the following directories and their contents to be owned by the web server: * /var/www/html/reviewboard1/htdocs/media/uploaded * /var/www/html/reviewboard1/htdocs/media/ext * /var/www/html/reviewboard1/htdocs/static/ext * /var/www/html/reviewboard1/data
Change the permissions to the below mentioned paths to resolve permission related issues ReviewBoard installation complete Guide Ubuntu OS
root@TechTutorials:~# chown -R www-data /var/www/html/reviewboard1/htdocs/media/uploaded root@TechTutorials:~# chown -R www-data /var/www/html/reviewboard1/htdocs/media/ext root@TechTutorials:~# chown -R www-data /var/www/html/reviewboard1/htdocs/static/ext root@TechTutorials:~# chown -R www-data /var/www/html/reviewboard1/data
Copy the Config files to apache2 server config path
root@TechTutorials:/var/www/html# cp reviewboard1/conf/apache-wsgi.conf /etc/apache2/sites-available/reviewboard1.conf root@TechTutorials:/var/www/html# cd /etc/apache2/sites-available/
Delete Default site config files
root@TechTutorials:/etc/apache2/sites-available# rm -rf 000-default.conf default-ssl.conf
Install mod_wsgi module and enable to run the site
root@TechTutorials:/etc/apache2/sites-available# apt-get install libapache2-mod-wsgi
root@TechTutorials:/etc/apache2/sites-available# cd ../sites-enabled root@TechTutorials:/etc/apache2/sites-enabled# ln -s ../sites-available/reviewboard1.conf .
Edit below config file and change value of ALLOW_HOSTS
Before changing ALLOWED_HOSTS = [‘localhost.localdomain’]
ALLOWED_HOSTS = ['*']
Now restart your apache2 service then go to web page and login with admin user ReviewBoard installation complete Guide Ubuntu OS
Comment your feedback on the same