Phabricator is a free and open source suite of web applications for software development. It is built using PHP and uses MySQL to store its data. Phabricator help teams to develop different software applications. It is based on Facebook's internal tools. Phabricator is made up of mainly four components. Differential, a code review tool. Diffusion, a repository browser. Maniphest, a bug tracker and Phriction, a wiki. Apart from this it also contains a number of small tools. Phabricator integrates with Git, Mercurial and SVN. It is a very popular application and used by major companies such as Facebook, Fedora, Dropbox, Uber, Quora, Disqus etc.
Phabricator can be installed on systems with a small amount of RAM. You can also install it on your personal computer. To follow this tutorial you will 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. You will also need a domain name pointed towards your system.
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, you can proceed to install the LAMP stack. Start the LAMP installation by installing Apache web server and MariaDB, which is a fork of MySQL using the following command.
Although Phabricator can be installed on earlier versions of PHP but we will be installing it on the latest version of PHP which is PHP 7.1. The default YUM repository contains PHP version 5.4 only, hence we will need to use the Webtatic repository to install a version of PHP greater than 5.4. Run the following commands for installing EPEL repository as EPEL repository is required before we install Webtatic repository.
yum -y install epel-releaseyum -y updateyum clean all
Now install Webtatic repository using the following commands.
Once PHP is installed, you will need to configure few thing in php.ini configuration. Open /etc/php.ini using your favorite editor.
If you do not have nano installed, you can install it using yum -y install nano. Scroll down to find the following lines.
; Maximum amount of memory a script may consume (128MB)
memory_limit = 128M
You can increase the memory_limit to a higher amount so that the processing of PHP can also be done faster. Next, find the following line,
; Defines the default timezone used by the date functions
Change the timezone according to your country.
Next, find the following lines and set their values according to instructions provided.
post_max_size = 8M #Change it to at least 32M
upload_max_filesize = 2M #Change it to at least 32M
Save the file and exit from the editor.
Once the PHP settings are configured, start Apache web server and enable it to start at boot time, run the following command.
systemctl start httpdsystemctl enable httpd
Start MariaDB and enable it to start at boot time using the following commands.
systemctl start mariadbsystemctl enable mariadb
Now run the following command to secure your MariaDB 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 about removing test databases and anonymous users. Most of the questions are self-explanatory and you should answer yes or y to all the questions.
You can proceed further to install Git as it is required to clone the Phabricator repository. Install Git using following command.
yum -y install git
Now clone the required Phabricator files using following commands.
Once the above files are cloned. Setup the database credentials using the following commands.
cd /var/www/phabricator/phabricator/./bin/config set mysql.host localhost./bin/config set mysql.port 3306./bin/config set mysql.user root./bin/config set mysql.pass <MySQL-root-password>
Now populate the database using the following command.
You will be asked the following question when you run above command.
Before running storage upgrades, you should take down the Phabricator web
interface and stop any running Phabricator daemons (you can disable this
warning with --force).
Are you ready to continue? [y/N] y
Press Y to continue, the database will now be populated.
You can proceed further to provide the ownership of the files to the Apache web server process using the following command.
chown -R apache:apache /var/www/phabricator
You will also need to disable your SELinux otherwise, Phabricator won't be able to connect to the database. To temporary disable SELinux without restarting the server, run the following command.
To completely disable the SELinux you will need to edit /etc/selinux/config file.
If you don't have nano installed, you can install it using yum -y install nano Find the following line:
Change it to:
Now you will need to reboot your server so that the new configuration can take effect.
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. If you can want to use commercial SSL certificates instead, you can purchase SSL certificates from HostPresto.
To install Let's Encrypt client also called Certbot. Now install Certbot using the following command.
yum -y install python-certbot-apache
Once the installation finishes, run the following command to obtain the SSL certificates from Let's Encrypt. Make sure that your domain is pointed to the server, the Let's Encrypt will check the domain authority before providing the certificates.
certbot certonly --standalone -d yourdomain.com
This command will run Let's Encrypt client to obtain the certificates only but not to install it. --standalone tells the client to use in-built web server for authentication of domain authority. -d yourdomain.com tells the domain name for which the certificates needs to be obtained. 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.
Where yourdomain.com is your actual domain or subdomain. In the directory, you will find cert.pem which is your domains certificate and privkey.pem which is your certificate's private key.
Let's Encrypt SSL expires in 90 days, so it is recommended to set an automatic renewal for your certificates. Run the following command to open your crontab file.
In the above configuration change yourdomain.com to your actual domain. Also, make sure that the path to your SSL certificate and private key are correct. Once done, you will have to restart your Apache server so that the changes made can take effect.
systemctl restart httpd
You can now access the web interface of your Phabricator installation by going to the following URL.
If you have followed the tutorial correctly, you will see the following screen to setup administrator account else you will see a page with errors in installation.
Finally, you will need to configure few things before using the application for the production environment.
Start Phabricator daemon using the following command so that Phabricator can do the required background tasks.
cd /var/www/phabricator/phabricator/./bin/phd start
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. Run the following command for same.
cd /var/www/phabricator/phabricator/./bin/config set phabricator.base-uri 'https://yourdomain.com'
Replace your domain with the exact domain name you use to access the application.
Set the local repository path using following commands.
mkdir /var/repochown -R apache:apache /var/repo
Your application is now ready to use.
In this tutorial, we have learned how to install Phabricator on CentOS 7. You can now easily deploy the application on your server and use it for software development.
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...
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...