Create Your Own Software Development Platform using Phabricator on CentOS 7

By Sajid Qureshi, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud’s incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Phabricator is a free and open source collection of web applications that helps you to build your own software development platform for better software. Phabricator is ideal when you are working with multiple teams for software development. It is built using PHP and uses MySQL to store its data. Phabricator gives you a box of solid tools for a comparatively small setup cost. It is extremely fast and the tools are easy to learn and use. The major components of Phabricator are:

  1. Differential, a code review tool
  2. Diffusion, a repository browser
  3. Maniphest, a bug tracker
  4. Phriction, a wiki

In this tutorial, we will install and configure Phabricator on an Alibaba Cloud Elastic Compute Service (ECS) CentOS 7 server.

Prerequisites

  1. You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get a free account in your Alibaba Cloud account. If you don’t know about how to set up your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  2. A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.

Update Your System

We recommend you to install any new package on a freshly updated ECS server. You can upgrade all the available packages using the following command.

Install LAMP Stack

Once the system is updated, you can start the LAMP installation by installing Apache web server, MariaDB which will be used to store data and PHP with required modules. Execute the following command to install apache server and MariaDB.

We will install PHP version 7.1. The default yum repository contains PHP version 5.4, so you’ll need to first add the EPEL repository and then install PHP version 7.1.

Next, install the Webtatic repository using the following command.

Run the following command to install PHP 7.1 with required modules.

Next, you’ll need to edit the configuration in php.ini file using any text editor. Here we are using nano text editor, you can also install it using yum -y install nano.

Next, find the following lines in the file and change the memory limit to the highest amount.

Next, find the following lines in the file and change the timezone according to your region and uncomment the line.

Next, find the following lines and set their values according to instructions provided.

Save the file and exit from the text editor.

Start the Apache web server and enable it to automatically launch at boot time, using the following command.

Similarly, start the MariaDB and enable it to launch at the boot time.

Now, let’s make sure to harden the security of MariaDB installation. Execute the following command.

You will be asked to enter root password and press Enter button for none and proceed further. Answer Y to all the question asked and complete the process.

You will need to install Git and to do so run the following command.

Install Phabricator

You have installed all the dependencies required to install the Phabricator. Now you are ready to install it from git. Create a new directory and change your current directory to that directory using the following commands.

Clone the required Phabricator files using the following commands.

Next, you’ll need to setup the database credentials. Execute the following commands one by one and they will do the job for you.

Populate the phabricator scheme using the following command.

You’ll be asked the following questions, press Y to continue.

You should see the following result as output.

Next, change the ownership rules for the file to the Apache web server. Run the following command to do so.

It is recommended to use SSL for accessing Phabricator application through the web interface. Now we will need to generate SSL certificates from Let’s Encrypt client. You can use commercial SSL certificates instead, you can purchase SSL certificates from Alibaba Cloud.

Now, temporarily stop the Apache web server for installing Certbot using the following command.

Next, execute the following command to obtain SSL certificates. Make sure that your domain is pointed to the server.

It may ask you which SSL configuration to use during authentication, choose ssl.conf. All the changes made to the file will be automatically restored. Finally, provide your email address and accept the terms and condition. Once the certificates are generated, they are likely to be stored in the following directory.

In the directory, you will find fullchain.pemwhich is your domains certificate and privkey.pem which is your certificate's private key.

Let’s Encrypt SSL certificates expires in 90 days, so we recommended you to set an automatic renewal for your certificates. Run the following command to open your crontab file.

Add the following line to the file.

Create a Virtual Host

Create a new virtual host file for Phabricator using the following command.

Replace yourdomain.com with your actual domain. Now add the following content into the file.

In the above configuration change yourdomain.com to your actual domain.

Finally, restart the apache server and MariaDB to apply all the changes that we just configured. You can do so using the following commands.

You will need to disable SELinux otherwise, Phabricator won’t be able to connect to the database. To temporary disable SELinux without restarting the server, run the following command.

Web Interface

Open up your favorite web browser and visit https://yourdomain.com. Replace yourdomain.com with your actual domain name and you will see the following screen to set up an administrator account.

Provide the administrators details asked like username, password, and email then click Create Admin Account button. You will be now taken to your administrative dashboard.

You will need to configure a few things before you can use the Phabricator application for the production environment. First of all, start the Phabricator daemon using the following command so that Phabricator can do the required background tasks.

Next, configure the Base URI using the following command. It is important to configure the Base URI as most of the features in the application will be unavailable unless Base URI is configured.

Set the local repository path using following command.

Now Phabricator is completely configured and you can manage your web application from the administrative dashboard. You can add new repositories by clicking on Create Repository button.

You can review your application code using Differential component of Phabricator available on the left side of web page. You can browse all repositories using Diffusion component of Phabricator.

Conclusion

Congratulations! You have successfully installed Phabricator on your Alibaba Cloud Elastic Compute Service (ECS) CentOS 7 server. Now you can deploy your own software development platform using Phabricator.

Reference:https://www.alibabacloud.com/blog/create-your-own-software-development-platform-using-phabricator-on-centos-7_594357?spm=a2c41.12499246.0.0

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store