Phabricator is a suite of software project management tools, developed by Facebook. Currently, the project is still in an early testing stage, but seems stable enough to use for small projects.

This set of tools were developed to be used on a web server running Apache. I ditched Apache a couple of years ago in favor of NginX, and as a result, had to convert a few configurations from Apache to NginX. This is how I made Phabricator work on NginX:
Installing Phabricator
$ cd webroot/ # pick some install directory
webroot/ $ git clone git://github.com/facebook/libphutil.git
webroot/ $ git clone git://github.com/facebook/arcanist.git
webroot/ $ git clone git://github.com/facebook/phabricator.git
webroot/ $ cd phabricator
webroot/phabricator/ $ git submodule update --init
webroot/phabricator/ $ cd ..
Preparing the Database
After checking out the code from Git, you have to set up the database
webroot/ $ mysql -uroot < phabricator/resources/sql/init/initialize.sql
Configuring Phabricator
Create a new configuration file with the same name that will identify this installation, for example:
webroot/ $ vim phabricator/conf/custom/myconfig.conf.php
Then add the following array to the config file:
true,
// This will be the base domain for your install, and must be configured.
// Use "https://" if you have SSL. See below for some notes.
'phabricator.base-uri' => 'http://phabricator.example.com/',
// Connection information for MySQL.
'mysql.host' => 'localhost',
'mysql.user' => 'root',
'mysql.pass' => 'trustno1hunter2',
// Basic email domain configuration.
'metamta.default-address' => 'noreply@phabricator.example.com',
'metamta.domain' => 'phabricator.example.com',
// NOTE: Check default.conf.php for detailed explanations of all the
// configuration options, including these.
) + phabricator_read_config_file('production'); Configure NginX
This is where the installation differs from what they show you on the Phabricator website.
At a minimum, you will need the code below:
- Add a rewrite rule if a file for the request does not exist. We need this, because Phabricator makes use of AJAX requests
- You have to rewrite the URL to index.php?__PATH__=/$1
- Phabricator requires an environment (PHABRICATOR_ENV) to be set for this install. It will point to the custom config file you created earlier, but without the .conf.php part.
- Phabricator needs the SCRIPT_FILENAME, QUERY_STRING, REQUEST_METHOD, and REMOTE_ADDR to be set in order to work.
Depending on your setup, you will want to add this to a custom conf file, or to the nginx conf file: server {
server_name phabricator.example.com;
root /webroot/phabricator;
try_files $uri $uri/ /index.php;
location / {
index index.php;
if ( !-f $request_filename )
{
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
break;
}
}
location ~ .php$ {
fastcgi_pass localhost:9000;
fastcgi_index index.php;
#custom environment variable
fastcgi_param PHABRICATOR_ENV "custom/myconfig";
#required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
#variables to make the $_SERVER populate in PHP
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;
}
} Test your install
You will have to restart NginX to see the new configuration for Phabricator.
webroot/phabricator/ $ service nginx force-reload
If NginX restarted without any problems, open your browser and go to the server address you specified in the nginx server configuration file (server_name). In this case, it is phabricator.example.com
Follow the on screen instructions.
When the installation is done, you have to update the database schema and create an admin user account.
Updating the Database schema
Back in your terminal, enter the following: (Replace config/myconfig with your Phabricator environment)
webroot/phabricator/ $ PHABRICATOR_ENV=config/myconfig scripts/sql/upgrade_schema.php
Creating an admin user account
The final step is to create your admin user account. Again, you will have to run a script for this:
webroot/phabricator/ $ PHABRICATOR_ENV=config/myconfig bin/accountadmin
That should do it. You can now go back to your browser and log in.