Phabricator is multipurpose software. We are describing for using with bigger WordPress website for extra team works. For our business related works our S/W Engineers use Phabricator. In fact, the reason we typically use forums for blogs (receiving bugs, errata, suggestion etceteras for any post) can be done with Phabricator. Here is How to Install Phabricator on Ubuntu 14.04, Nginx Running on a Typical Cloud Server Instance. Development is related to Facebook, Facebook is related to PRISM. Hence, possibly you need to do a bit research about security for projects which demands huge security.
Some documentation are here :
1 | https://secure.phabricator.com/book/phabricator/article/configuration_guide/ |
After following this guide, you’ll do the later steps reading from there. For Apache, there is ready to use script :
---
1 | https://secure.phabricator.com/diffusion/P/browse/master/scripts/install/install_ubuntu.sh |
Install Phabricator on Ubuntu 14.04, Nginx : Requirements
Phabricator is designed to get installed on the root of a Fully Qualified Domain Name – either subdomain or domain. thecustomizewindows.com
or subdomain like report.thecustomizewindows.com
. That may be a problem with HSTS setup, if WordPress is already running on the same server. In other words, use VPSDime like $7/month great 6GB server (Use without fear. No downtime, better than Rackspace.) and use a third party DNS service provider like CloudFlare or paid like Dyn, install SSL certificate for Nginx in normal way. Yes, the full work will take time.
We will assume that nothing is installed on the server. We will not discuss about SSL/TLS certificate installation. Use the search function on our website to get help for problems with steps.
Install Phabricator on Ubuntu 14.04, Nginx : Steps
Following the full guide to install, optimize LEMP for WordPress actually will work fine. However, we have to “officially” write the steps!
Installing PHP and Other Stuffs
1 | apt-get install -y subversion git-core git php5-fpm php5-mysql php5-curl php5-mysql php5-gd php5-cli php5-dev php5-json |
Edit the file :
1 2 3 4 5 6 7 8 | nano /etc/php5/cli/php.ini # use ^ + W # to find date.timezone # and add date.timezone = Calcutta/Asia # see php timezones - http://php.net/manual/en/timezones.asia.php # use ^ + W to find apc.stat, add apc.stat = Off |
repeat it for /etc/php5/fpm/php.ini
, then do configtest with php5-fpm -t
and reload with service php5-fpm restart
command(s).
Installing Nginx as Webserver
We are installing Nginx Extras from repo :
1 2 3 4 5 6 | sudo useradd -g www-data nginx usermod -a -G www-data nginx # reboot, exit ssh session and login sudo apt–get install nginx-extras # create this dir mkdir -p /var/repo |
We think, you know how to configure Nginx for PHP, in case you never used Nginx, configure with our previous guide.
Our normal root is /usr/share/nginx/html
for Nginx’s public FTP and vhost file is /etc/nginx/sites-available/default
. We do not change these as for guides. It is a moronic work to change them. If we cd
to /usr/share/nginx/html
to work, that will append phabricator/webroot
as web root. If you cd
to /usr/share/
and create phabricator
directory, /usr/share/phabricator/phabricator/webroot
as root. It is more moronic to see phabricator
twice in path. Instead we can chown
, chgrp
to proper settings to secure the installation. So :
We will work by going to : /usr/share/nginx/html
Nginx – Phabricator will set FTP root to : /usr/share/nginx/html/phabricator/webroot
We will run various scripts from : /usr/share/nginx/html/phabricator/
We can install Phabricator from :
1 | https://github.com/phacility/phabricator |
But we will install from github.com/facebook/phabricator
, so starting from :
1 2 3 4 | cd /usr/share/nginx/html/ git clone git://github.com/facebook/libphutil.git git clone git://github.com/facebook/arcanist.git git clone git://github.com/facebook/phabricator.git |
We need to chgrp
the /usr/share/nginx/html/phabricator/webroot
to root:www-data
:
1 | sudo chown www-data:nginx /usr/share/nginx/html/phabricator/webroot -R |
As we will install on /usr/share/nginx/html/phabricator/webroot
, so that typical configuration needs modification for non-SSL as example (you should configtest with nginx -t
command, it is not tested) :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | server { server_name report.thecustomizewindows.com; root /usr/share/nginx/html/phabricator/webroot; try_files $uri $uri/ /index.php; location / { index index.php; if ( !-f $request_filename ) { rewrite ^/(.*)$ /index.php?__path__=/$1 last; break; } } location /index.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param REDIRECT_STATUS 200; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; } } |
For SSL as example :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | server { listen 80; server_name report.thecustomizewindows.com; root /usr/share/nginx/html; location / { rewrite ^ https://$http_host$request_uri? permanent; } } server { listen 443 ssl; server_name report.thecustomizewindows.com; root /usr/share/nginx/html/phabricator/webroot; try_files $uri $uri/ /index.php; ssl on; # certs at /etc/nginx/ssl/report/ ssl_certificate /etc/nginx/ssl/report/thecustomizewindows.com.crt; ssl_certificate_key /etc/nginx/ssl/report/thecustomizewindows.com.key; ssl_session_timeout 30m; location / { index index.php; if ( !-f $request_filename ) { rewrite ^/(.*)$ /index.php?__path__=/$1 last; break; } location /index.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param REDIRECT_STATUS 200; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; } } |
Check the /etc/php5/fpm/pool.d/www.conf
for listen = 127.0.0.1:9000
, we are not using UNIX socket, else you’ll get odd 502 error like if we use UNIX socket on www.conf but port 9000 on default Nginx configuration file. Keep in mind – normally we use UNIX socket in our all guides, we are using port here, i.e. 127.0.0.1:9000
as not huge number of users reported any problems with UNIX socket and port, unlike WordPress. Port is fail safe.
Installing MySQL for Phabricator on Ubuntu 14.04
We are installing Percona MySQL :
1 2 3 4 5 6 7 8 9 | apt update –y && apt upgrade apt dist–upgrade apt–key adv —keyserver keys.gnupg.net —recv–keys 1C4CBDCDCD2EFD2A echo “deb http://repo.percona.com/apt lsb_release -cs main” >> /etc/apt/sources.list.d/percona.list echo “deb-src http://repo.percona.com/apt lsb_release -cs main” >> /etc/apt/sources.list.d/percona.list apt–get update sudo apt–get install percona–server–server–5.6 percona–server–client–5.6 sudo mysql_install_db sudo mysql_secure_installation |
Create a database :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | mysql –u root –h localhost –p # run after login CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'; CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'; CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'; # you should exit exit # then restart mysql service mysql restart # mysql –u root –h localhost –p # In case you need non-root user and own database CREATE USER 'yourserver2016'@'localhost' IDENTIFIED BY 'BADPASSWORD__a&ET#'; CREATE DATABASE phabricator2016; GRANT SELECT,DELETE,INSERT,UPDATE ON phabricator2016.* TO 'yourserver2016'@'localhost'; GRANT ALL PRIVILEGES ON phabricator2016.* TO 'yourserver2016'@'localhost'; FLUSH PRIVILEGES; |
Most important to read how to “enable” Auto Restart of MySQL. In /etc/mysql/my.cnf
add the following lines under the [mysqld]
section :
1 2 | sql_mode= STRICT_ALL_TABLES ft_min_word_len= 3 |
Restart with service mysql restart
command. Actually, Phabricator has script to create database, you can run in this way, change password
to your password, user to the created user in above steps.
1 2 3 4 5 6 | cd /usr/share/nginx/html/phabricator/ ./bin/config set mysql.host 127.0.0.1 ./bin/config set mysql.port 3306 ./bin/config set mysql.user yourserver2016 ./bin/config set mysql.pass BADPASSWORD__a&ET# ./bin/storage upgrade --user yourserver2016 --password BADPASSWORD__a&ET# |
These commands set the base URI and forces all the daemons to start :
1 2 3 4 5 | cd /usr/share/nginx/html/phabricator/ ./bin/config set phabricator.base-uri 'https://report.thecustomizewindows.com/' ./bin/phd start # use only if you are getting error in the next step ./bin/accountadmin |
Now, visit that subdomain on Browser and start installation like WordPress.
Enabling Notification and Auto Restart on Reboot
We need Node.js :
1 2 3 | sudo apt-get install nodejs /usr/share/nginx/html/phabricator/bin/config set notification.enabled true /usr/share/nginx/html/phabricator/bin/aphlict start |
Edit /etc/rc.local
to automate start on reboot, add :
1 2 | /usr/share/nginx/html/phabricator/bin/phd start /usr/share/nginx/html/phabricator/bin/aphlict start |
Thats it.
Tagged With erver_name phabricator example com; root /path/to/phabricator/webroot; location / { index index php; rewrite ^/( *)$ /index php?__path__=/$1 last; } location /index php { fastcgi_pass localhost:9000; fastcgi_index index php; #required if PHP was built wit , https://thecustomizewindows com/2015/12/install-phabricator-on-ubuntu-14-04-nginx-cloud-server/ , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1840 9uvqmdl1Tw4YATnLcsUHO6_7uO80kJsRPFgRXRjUXNpvm8Flp-wfWynQZzf8cSvv 4911f672c7f5f8db580962971412036ad534bddd&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , install phabricator , installing phabricator on ubuntu , ubuntu apt phabricator , ubuntu phabricator