• Get In Touch
January 29, 2017

How to Install Laravel GitScrum on CentOS 7

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Laravel GitScrum is a free and open source application developed in PHP Laravel. It is built to help the developer team to use Git and Scrum on the same interface for day to day task management. It comes with many features such as it can be easily integrated with GitHub or GitLab. Further, it has Product Backlog feature which contains the Product Owner’s assessment of business value. It also has features like User Story, Sprint Backlog, and Issues managements. The application is responsive and can be used in different devices.

In this tutorial, we will be installing GitScrum on CentOS 7. We will also install all the required dependencies which include Apache, PHP 5.6, Node.js, and MariaDB.

Requirements

GitScrum can be installed on systems with least of RAM, but the requirement of RAM increase as the number of users increases. You will also need a minimal installation of CentOS 7 with root access on it. If you are logged in as a non-root user, you can run sudo -i to switch to root user.

Installing GitScrum

Before installing any package it is recommended that you update the packages and repository using the following command.

yum -y update

Once you have your system updated, run the following command to install few packages on your server.

yum -y install httpd mariadb-server mariadb git

The above command will install Apache web server with MariaDB database server and Git. Now you will need to install PHP. GitScrum supports both PHP 5.6 and 7.0. In this tutorial, we will learn to install both PHP 5.6 and 7.0. You must install only one version of PHP. The YUM repository contains PHP version 5.4 only, hence we will need to use the Webtatic repository to install a version of PHP 5.6 or 7.0. Run the following commands for installing EPEL repository as EPEL repository is required before we install Webtatic repository.

yum -y install epel-release
yum -y update

Now install Webtatic repository using the following commands.

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y update
yum clean all

To install PHP 5.6 and all the required PHP modules, run the following command.

yum -y install php56w php56w-cli php56w-curl php56w-gd php56w-mysql php56w-mcrypt php56w-mbstring php56w-zip php56w-dom

To install PHP 7.0 and all the required PHP modules, run the following command.

yum -y install php70w php70w-cli php70w-curl php70w-gd php70w-mysql php70w-mcrypt php70w-mbstring php70w-zip php70w-dom

Make sure that you are using only one of the PHP versions mentioned above. Once you have PHP installed, you can check the version of PHP using the following command.

php -v

You should get following output.

[root@liptan ~]# php -v
PHP 7.0.14 (cli) (built: Dec 10 2016 11:35:27) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

You will need to enable Mod_rewrite by editing /etc/httpd/conf/httpd.conf using your favorite text editor.

nano /etc/httpd/conf/httpd.conf

If you do not have nano installed, you can install it using yum -y install nano. Find the following line under <Directory "/var/www/html"> block.

AllowOverride None

Change it to AllowOverride All.

Now install Composer using the following command. Composer is a dependency manager for PHP.

curl -sS https://getcomposer.org/installer | php

Once Composer is installed, move the script to the /usr/bin so that it is executable directly.

mv composer.phar /usr/bin/composer

Now install the latest version of Node.js from the Nodesource repository. Run the following command to add the Nodesource repository in your system.

curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -

Run the following command to install Node.js.

yum -y install nodejs

To start Apache web server and enable it to start at boot time, run the following command.

systemctl start httpd
systemctl enable httpd

Start MariaDB and enable it to start at boot time using the following commands.

systemctl start mariadb
systemctl enable mariadb

Now run the following command to secure your MariaDB installation.

mysql_secure_installation

It will run a small script which asks you to provide the root password for MariaDB. As we have just installed MariaDB, the root password is not set, just press enter to proceed further. It will ask you if you want to set a root password for your MariaDB installation, choose y and set a strong password for the installation. It will also ask you for removing test databases and anonymous users. Most of the questions are self-explanatory and you should answer yes or y to all the questions.

Now you will need to create a database with database user to store GitScrum data. To create a database we will need to login to MySQL command line first. Run the following command for same.

mysql -u root -p

This will prompt you for the root password, provide the root password of MySQL which you have set earlier. Now run the following query to create a new database for your GitScrum installation.

CREATE DATABASE gitscrum_data;

The above query will create a database named gitscrum_data. For the database, you can use any name you prefer in the place of gitscrum_data. Make sure that you use semicolon at the end of each query as the query always ends with a semicolon. Once the database is created you can create a new user and grant all the permissions to the user for the database. To create a new database user, run the following query.

CREATE USER 'gitscrum_user'@'localhost' IDENTIFIED BY 'StrongPassword';

The above query will create a user with username gitscrum_user. You can use any preferred username instead of gitscrum_user. Replace StrongPassword with a strong password. Now provide the appropriate privileges to your database user over the database you have created. Run the following command:

GRANT ALL PRIVILEGES ON gitscrum_data.* TO 'gitscrum_user'@'localhost';

Now run the following command to immediately apply the changes on the database privileges.

FLUSH PRIVILEGES;

Exit MySQL prompt by executing exit command.

Now install GitScrum, by cloning the repository on your system.

cd /var/www/html
git clone https://github.com/renatomarinho/laravel-gitscrum.git .

Now install GitScrum using the following command.

composer update
composer run-script post-root-package-install

The above command will download and install all the required dependencies. Now you will need to edit the .env file, run the following command for the same.

nano /var/www/html/.env

At the start of the file, you will see following lines.

APP_URL=http://app.gitcodex.dev
APP_TITLE=GitScrum

Change the APP_URL to the domain name of your application. You must also choose the protocol, http or https. Change APP_TITLE to any title you want to use for your application.

Also, you will need to create an application either on Github or Gitlab. If you are using Github, go to the Github OAuth application page and fill out the form with the following details.

Application name: <Same as your APP_TITLE>
Homepage URL: <Same as APP_URL at .env>
Application description: <A description for your app>
Authorization callback URL: http://<URL is the SAME APP_URL>/auth/provider/github/callback

You will get the GITHUB_CLIENT_ID= and GITHUB_CLIENT_SECRET, which you will need to provide in the following lines in .env file. It should look similar to this.

GITHUB_CLIENT_ID=5dc2e8c812452b0d8w2d1
GITHUB_CLIENT_SECRET=4e200532e4b3edj712850c23353af43f692e20d0

Next, Provide mysql in DB_CONNECTION= as we are using MariaDB which is a fork of MySQL. Provide 127.0.0.1 in DB_HOST=. Leave the database port to 3306. Further provide the database name, username, and database password, which we have created earlier. Finally, it should look like shown below.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=gitscrum_data
DB_USERNAME=gitscrum_user
DB_PASSWORD=StrongPassword

Once .env file has been populated, run the following command to initialize GitScrum database.

php artisan GitScrum:init

Now you will need to disable your SELinux because MyBB does not work with SELinux policies. To temporary disable SELinux, run the following command.

setenforce 0

To completely disable the SELinux you will need to edit /etc/selinux/config file.

nano /etc/selinux/config

If you don’t have nano installed, you can install it using yum -y install nano Find the following line:

SELINUX=enforcing

Change it to:

SELINUX=disabled

Now you will need to reboot your server so that the new configuration can take effect. Once the server is rebooted, you will need to provide the ownership of the application to web server user using the following command.

chown -R apache:apache /var/www/html

Furthermore, you will need to create a virtual host file so that the application is accessible from URL provided. Create a new virtual host file using the following command.

nano /etc/httpd/conf.d/yourdomain.com.conf

<VirtualHost *:80>
    ServerAdmin admin@yourdomain.com
    DocumentRoot /var/www/html/public/
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com

    <Directory /var/www/html/public/>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/httpd/yourdomain.com-error_log
    CustomLog /var/log/httpd/yourdomain.com-access_log common

</VirtualHost>

Replace yourdomain.com with the actual domain you used in .env. Now restart the web server using the following command.

systemctl restart httpd

Now you can go to the following URL to browse the GitScrum interface using your favorite browser.

http://yourdomain.com

You will see the following interface.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/454399479.png” alt=”” />

You can now log in with Github or GitLab. In our case only GitHub as we have configured GitHub OAuth only. Once you are logged in, you will see the following dashboard.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/1781662243.png” alt=”” />

Conclusion

In this tutorial, we have learned how to install Laravel GitScrum in your CentOS 7 server. You can now deploy GitScrum on your server to increase the productivity of your team and organization.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]