Phabricator was originally developed by Facebook. We actually had an old guide on installing Phabricator. But probably that old guide will not work with new version. Phabricator is essentially a PHP Based Web Application With Many Web Suites. This Guide Describe the Steps to Install Phabricator on Cloud Server Running CentOS. You need to know many things to use it. You can look at phabricator.wikimedia.org
, developer.blender.org
to realise the power of all in software for chat, blog, wiki, question and answer to code hosting.
Prerequisites Steps to Install Phabricator on Cloud Server
We need a fresh cloud server instance running CentOS. Phabricator does not support PHP 7.x, we need to use PHP 5.x. We recommend to use Apache2 instead of Nginx. We need full database with full privileges as Phabricator will create many databases. Note that – in contrast normal web softwares like WordPress needs one database.
You can use VPSDime 6GB RAM OpenVZ server at $7/month or ArubaCloud 1 GB VMWare instance at £1.00 per month or Host1Plus is not exactly cost effective. Question of using DigitalOcean, Linode etc does not arises as they cost minimum $10.00 for 1GB to 2GB instances.
---
You need a domain or subdomain. We have a list of free domain names.
You can use free Hurricane Electric DNS or Dyn DNS or read our list of Dyn Providers.
Optionally you can use KeyCDN as CDN.
Optionally you can use Let’s Encrypt free SSL certificate.
Steps to Install Phabricator on Cloud Server (CentOS)
Actually installing Phabricator is just easy. First we will install MySQL, you will use password without special character (very important, Phabricator can give error if you use password like Pa$$word) :
1 2 3 4 5 6 7 8 9 10 | sudo yum update wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm yum update sudo yum install mysql-server mysql-client # chkconfig mysqld on service mysql start # chkconfig mysqld on chkconfig mysql on mysql_secure_installation |
Next, we will install PHP :
1 2 3 4 5 6 7 8 | wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -ivh epel-release-latest-7.noarch.rpm yum update yum install git php-fpm php-cli php-mysql php-process php-devel php-gd php-pecl-apc php-pecl-json php-mbstring mercurial subversion python-pygments sendmail imagemagick pcre-devel # reboot # run php -v to make sure it is PHP 5.x; if PHP 7.0 get installed, remove it. # Install PHP 5.x sudo yum install php-pear sudo pecl install apc |
Once APC is installed, test that it is available by running:
1 | php -i | grep apc |
If it doesn’t show up, add:
1 | extension=apc.so |
to php.ini
file indicated by php -i
. As we started with a blank server, we have option to use this script distributed by Phabricator (kindly note that, Phabricator can change URL in future. It works at the time of writing this guide), it will automate the next steps :
1 | https://secure.phabricator.com/diffusion/P/browse/master/scripts/install/install_rhel-derivs.sh |
cd
to ~
as root
and :
1 2 3 4 5 | nano install_rhel-derivs.sh # paste the whole bash script from https://secure.phabricator.com # URL given above text in this guide # save it with ^ + O # exit nano |
If I have shown to wget, you may be using old one at the time of reading. Now execute the script :
1 2 | chmod +x install_rhel-derivs.sh ./install_rhel-derivs.sh |
The installation will start now. Press Enter to continue when prompted. It will install Apache2 as well. At the end, you will see this message :
1 2 | Install probably worked mostly correctly. Continue with the 'Configuration Guide': http://www.phabricator.com/docs/phabricator/article/Configuration_Guide.html |
If you install Nginx (you need to modify the above script to exclude httpd), then you need to follow this steps (we do not suggest Nginx), most of you are not following this step :
1 2 3 4 | wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm service nginx start chkconfig nginx on |
If you run ls
you’ll get like this :
1 2 | anaconda-ks.cfg arcanist install.log install.log.syslog install_rhel-derivs.sh libphutil phabricator |
We will move the needed directories to the Apache root document directory :
1 | cp -fr arcanist/ libphutil/ phabricator/ /var/www/html/ |
Now, cd
to /var/www/html/
:
1 2 3 4 | cd /var/www/html/ ls -al cd phabricator ls -al |
We need to start Apache2 :
1 2 | service httpd start chkconfig httpd on |
We need to configure Apache configuration file with your domain name, take that your domain is example.com
:
1 | nano /etc/httpd/conf/httpd.conf |
You will see how many lines are loaded, go to last line by ^
+ _
within nano. Paste just above those directives to include stuffs :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <VirtualHost *> # Change this to the domain which points to your host. ServerName example.com # Change this to the path where you put 'phabricator' when you checked it # out from GitHub when following the Installation Guide. # # Make sure you include "/webroot" at the end! DocumentRoot /var/www/html/phabricator/webroot/ RewriteEngine on RewriteRule ^/rsrc/(.*) - [L,QSA] RewriteRule ^/favicon.ico - [L,QSA] RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA] <Directory "/var/www/html/phabricator/webroot/"> Order allow,deny Allow from all </Directory> </VirtualHost> |
We will restart Apache2. You need to point your domain from DNS with very low TTL value. Then restart Apache :
1 | service httpd restart |
As for database part, we will use root
as user. You may create :
1 2 3 | CREATE USER 'youruser'@'localhost' IDENTIFIED BY 'yourpassword'; GRANT ALL PRIVILEGES ON *.* TO 'youruser'’@'localhost'; FLUSH PRIVILEGES; |
But, basically it is not hugely secure only to change the username. We are not creating one database and giving that user privilege. MySQL server demands workup by you later for ensuring higher security.
Run all these commands one by one while inside /var/www/html/phabricator/
directory :
1 2 3 4 | ./bin/config set mysql.host localhost ./bin/config set mysql.user root ./bin/config set mysql.pass your-mysql-root-password ./bin/storage upgrade --user root --password your-mysql-root-password |
Restart mysql service :
1 2 | service mysql restart # service mysqld restart |
Simply you will run this command to set your domain:
1 | ./bin/config set phabricator.base-uri 'http://example.com/' |
When you will use HTTPS later, you can upgrade it by running the new one. Restart the services :
1 2 3 | service httpd restart service mysqld restart ./bin/phd restart |
Open up your Web browser and open http://your-domain-like-example.com/
in the address bar. You should see a configuration screen to set administrator account. The first step is to setup admin account name, real name, and password etc.
In case, you are having trouble with WebGUI (like getting message of being unauthorised), in such case, you can reset it using a command which can be found by performing a Google search with your problem. As far I can recall, the command format is :
1 | ./bin/auth recover |
You will notice that, on Web GUI, there are “Unresolved Setup Issues”. Click and see the list. It is usually around 13 – 14 issues.
Never delete the files on /var/www/html/
. There are JSON files. If you login to your MySQL server and list the databases :
1 2 3 | mysql -u root -h localhost -p # login show databases; |
You’ll see how many databases Phabricator actually need.
Tagged With phabricator , phabricator rpm el7