2011-02-11 14:58:45 -08:00
|
|
|
@title Configuration Guide
|
|
|
|
@group config
|
|
|
|
|
|
|
|
This document contains basic configuration instructions for Phabricator.
|
|
|
|
|
|
|
|
= Prerequisites =
|
|
|
|
|
|
|
|
This document assumes you've already installed all the components you need.
|
|
|
|
If you haven't, see @{article:Installation Guide}.
|
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
The next steps are:
|
2011-05-05 11:00:05 -07:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
- Configure your webserver (Apache, nginx, or lighttpd).
|
|
|
|
- Access Phabricator with your browser.
|
|
|
|
- Follow the instructions to complete setup.
|
Make SQL patch management DAG-based and provide namespace support
Summary:
This addresses three issues with the current patch management system:
# Two people developing at the same time often pick the same SQL patch number, and then have to go rename it. The system catches this, but it's silly.
# Second/third-party developers can't use the same system to manage auxiliary storage they may want to add.
# There's no way to build mock databases for unit tests that need to do reads.
To resolve these things, you can now name your patches whatever you want and conflicts are just merge conflicts, which are less of a pain to fix than filename conflicts.
Dependencies are now a DAG, with implicit dependencies created on the prior patch if no dependencies are specified. Developers can add new concrete subclasses of `PhabricatorSQLPatchList` to add storage management, and define the dependency branchpoint of their patches so they apply in the correct order (although, generally, they should not depend on the mainline patches, presumably).
The commands `storage upgrade --namespace test1234` and `storage destroy --namespace test1234` will allow unit tests to build and destroy MySQL storage.
A "quickstart" mode allows an upgrade from scratch in ~1200ms. Destruction takes about 200ms. These seem like fairily reasonable costs to actually use in tests. Building from scratch patch-by-patch takes about 6000ms.
Test Plan:
- Created new databases from scratch with and without quickstart in a separate test namespace. Pointed the webapp at the test namespaces, browsed around, everything looked good.
- Compared quickstart and no-quickstart dump states, they're identical except for mysqldump timestamps and a few similar things.
- Upgraded a legacy database to the new storage format.
- Destroyed / dumped storage.
Reviewers: edward, vrana, btrahan, jungejason
Reviewed By: btrahan
CC: aran, nh
Maniphest Tasks: T140, T345
Differential Revision: https://secure.phabricator.com/D2323
2012-04-30 07:54:00 -07:00
|
|
|
|
2012-01-16 16:05:00 -08:00
|
|
|
= Webserver: Configuring Apache =
|
2011-02-11 14:58:45 -08:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
NOTE: Follow these instructions to use Apache. To use nginx or lighttpd, scroll
|
|
|
|
down to their sections.
|
|
|
|
|
2011-02-11 14:58:45 -08:00
|
|
|
Get Apache running and verify it's serving a test page. Consult the Apache
|
|
|
|
documentation for help. Make sure ##mod_php## and ##mod_rewrite## are enabled,
|
|
|
|
and ##mod_ssl## if you intend to set up SSL.
|
|
|
|
|
|
|
|
If you haven't already, set up a domain name to point to the host you're
|
|
|
|
installing on. You can either install Phabricator on a subdomain (like
|
|
|
|
phabricator.example.com) or an entire domain, but you can not install it in
|
|
|
|
some subdirectory of an existing website. Navigate to whatever domain you're
|
|
|
|
going to use and make sure Apache serves you something to verify that DNS
|
|
|
|
is correctly configured.
|
|
|
|
|
2013-01-28 17:45:56 -08:00
|
|
|
NOTE: The domain must contain a dot ('.'), i.e. not be just a bare name like
|
|
|
|
'http://example/'. Some web browsers will not set cookies otherwise.
|
|
|
|
|
2011-02-11 14:58:45 -08:00
|
|
|
Now, either create a VirtualHost entry (to put Phabricator on a subdomain)
|
|
|
|
or edit the Directory entry for the DocumentRoot. It should look something like
|
|
|
|
this:
|
|
|
|
|
2012-01-16 16:05:00 -08:00
|
|
|
name=httpd.conf
|
2011-02-11 14:58:45 -08:00
|
|
|
<VirtualHost *>
|
2013-01-23 12:03:19 -08:00
|
|
|
# Change this to the domain which points to your host.
|
2011-02-11 14:58:45 -08:00
|
|
|
ServerName phabricator.example.com
|
2011-03-06 14:56:12 -08:00
|
|
|
|
2011-02-11 14:58:45 -08:00
|
|
|
# Change this to the path where you put 'phabricator' when you checked it
|
2013-01-23 12:03:19 -08:00
|
|
|
# out from GitHub when following the Installation Guide.
|
|
|
|
#
|
|
|
|
# Make sure you include "/webroot" at the end!
|
2011-02-11 14:58:45 -08:00
|
|
|
DocumentRoot /path/to/phabricator/webroot
|
2011-03-06 14:56:12 -08:00
|
|
|
|
2011-02-11 14:58:45 -08:00
|
|
|
RewriteEngine on
|
|
|
|
RewriteRule ^/rsrc/(.*) - [L,QSA]
|
|
|
|
RewriteRule ^/favicon.ico - [L,QSA]
|
2012-03-15 15:14:24 -07:00
|
|
|
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
|
2011-02-11 14:58:45 -08:00
|
|
|
</VirtualHost>
|
2011-03-06 14:56:12 -08:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
If Apache isn't currently configured to serve documents out of the directory
|
|
|
|
where you put Phabricator, you may also need to add a section like this:
|
|
|
|
|
|
|
|
<Directory "/path/to/phabricator/webroot">
|
|
|
|
Order allow,deny
|
|
|
|
Allow from all
|
|
|
|
</Directory>
|
|
|
|
|
|
|
|
After making your edits, restart Apache, then continue to "Setup" below.
|
2012-01-16 16:05:00 -08:00
|
|
|
|
|
|
|
= Webserver: Configuring nginx =
|
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
NOTE: Follow these instructions to use nginx. To use Apache or lighttpd, scroll
|
|
|
|
to their sections.
|
|
|
|
|
2012-01-16 16:05:00 -08:00
|
|
|
For nginx, use a configuration like this:
|
|
|
|
|
|
|
|
name=nginx.conf
|
|
|
|
server {
|
|
|
|
server_name phabricator.example.com;
|
|
|
|
|
|
|
|
root /path/to/phabricator/webroot;
|
|
|
|
try_files $uri $uri/ /index.php;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
index index.php;
|
|
|
|
|
|
|
|
if ( !-f $request_filename )
|
|
|
|
{
|
|
|
|
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-14 15:38:55 -07:00
|
|
|
location /index.php {
|
2012-01-16 16:05:00 -08:00
|
|
|
fastcgi_pass localhost:9000;
|
|
|
|
fastcgi_index index.php;
|
|
|
|
|
|
|
|
#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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
Restart nginx after making your edits, then continue to "Setup" below.
|
|
|
|
|
Add docs for using lighttpd as the webserver.
lighttpd could support rules like this, to add efficiency:
# Aggressively cache all static files
$HTTP["url"] =~ "\.(jpg|gif|png|css|js|htc)" {
expire.url = ( "" => "access 1 years" )
}
# Compress files for faster transfer
compress.filetype = (
"text/plain",
"text/html",
"text/javascript",
"text/css",
"text/xml"
)
compress.cache-dir = <would need to set to something>?
I don't know if that is necessary or useful. Probably not a good idea
at this point, where the code is changing so rapidly: a 1 year cache
of javascript code could cause trouble. And i think the default
lighttpd.conf already compresses text/html, text/plain, text/css, and
application/x-javascript by default, so we're ok there (could add
text/javascript and text/xml, I guess).
2012-05-03 13:28:04 -07:00
|
|
|
= Webserver: Configuring lighttpd =
|
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
NOTE: Follow these instructions to use lighttpd. To use Apache or niginx, scroll
|
|
|
|
up to their sections.
|
|
|
|
|
Add docs for using lighttpd as the webserver.
lighttpd could support rules like this, to add efficiency:
# Aggressively cache all static files
$HTTP["url"] =~ "\.(jpg|gif|png|css|js|htc)" {
expire.url = ( "" => "access 1 years" )
}
# Compress files for faster transfer
compress.filetype = (
"text/plain",
"text/html",
"text/javascript",
"text/css",
"text/xml"
)
compress.cache-dir = <would need to set to something>?
I don't know if that is necessary or useful. Probably not a good idea
at this point, where the code is changing so rapidly: a 1 year cache
of javascript code could cause trouble. And i think the default
lighttpd.conf already compresses text/html, text/plain, text/css, and
application/x-javascript by default, so we're ok there (could add
text/javascript and text/xml, I guess).
2012-05-03 13:28:04 -07:00
|
|
|
For lighttpd, add a section like this to your lighttpd.conf:
|
|
|
|
|
|
|
|
$HTTP["host"] =~ "phabricator(\.example\.com)?" {
|
|
|
|
server.document-root = "/path/to/phabricator/webroot"
|
|
|
|
url.rewrite-once = (
|
|
|
|
"^(/rsrc/.*)$" => "$1",
|
|
|
|
"^(/favicon.ico)$" => "$1",
|
|
|
|
# This simulates QSA ("query string append") mode in apache
|
|
|
|
"^(/[^?]*)\?(.*)" => "/index.php?__path__=$1&$2",
|
|
|
|
"^(/.*)$" => "/index.php?__path__=$1",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
You should also ensure the following modules are listed in your
|
|
|
|
server.modules list:
|
|
|
|
|
|
|
|
mod_fastcgi
|
|
|
|
mod_rewrite
|
|
|
|
|
|
|
|
Finally, you should run the following commands to enable php support:
|
|
|
|
|
|
|
|
$ sudo apt-get install php5-cgi # for ubuntu; other distros should be similar
|
|
|
|
$ sudo lighty-enable-mod fastcgi-php
|
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
Restart lighttpd after making your edits, then continue below.
|
2012-01-16 16:05:00 -08:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
= Setup =
|
2011-05-05 11:00:05 -07:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
Now, navigate to whichever subdomain you set up. You should see instructions to
|
|
|
|
continue setup. The rest of this document contains additional instructions for
|
|
|
|
specific setup steps.
|
2011-05-05 11:00:05 -07:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
When you see the login screen, continue with @{article:Configuring Accounts and
|
|
|
|
Registration}.
|
2011-05-05 11:00:05 -07:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
= Storage: Configuring MySQL =
|
2011-05-05 11:00:05 -07:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
During setup, you'll need to configure MySQL. To do this, get MySQL running and
|
|
|
|
verify you can connect to it. Consult the MySQL documentation for help. When
|
|
|
|
MySQL works, you need to load the Phabricator schemata into it. To do this, run:
|
2011-02-11 14:58:45 -08:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
phabricator/ $ ./bin/storage upgrade
|
2011-02-11 14:58:45 -08:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
If your configuration uses an unprivileged user to connect to the database, you
|
|
|
|
may have to override the default user so the schema changes can be applied with
|
|
|
|
root or some other admin user:
|
2011-02-11 14:58:45 -08:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
phabricator/ $ ./bin/storage upgrade --user <user> --password <password>
|
2011-03-06 14:56:12 -08:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
You can avoid the prompt the script issues by passing the ##--force## flag (for
|
|
|
|
example, if you are scripting the upgrade process).
|
2011-02-11 14:58:45 -08:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
phabricator/ $ ./bin/storage upgrade --force
|
2011-03-06 14:56:12 -08:00
|
|
|
|
2013-01-23 12:03:19 -08:00
|
|
|
NOTE: When you update Phabricator, run `storage upgrade` again to apply any
|
|
|
|
new updates.
|
2011-04-11 16:47:51 -07:00
|
|
|
|
2011-05-12 08:15:02 -07:00
|
|
|
= Next Steps =
|
|
|
|
|
|
|
|
Continue by:
|
|
|
|
|
2011-05-12 11:02:59 -07:00
|
|
|
- setting up your admin account and login/registration with
|
|
|
|
@{article:Configuring Accounts and Registration}; or
|
2013-01-23 12:03:19 -08:00
|
|
|
- understanding advanced configuration topics with
|
|
|
|
@{article:Configuration User Guide: Advanced Configuration}; or
|
2012-07-02 15:22:35 -07:00
|
|
|
- configuring where uploaded files and attachments will be stored with
|
2011-07-19 22:48:38 -07:00
|
|
|
@{article:Configuring File Storage}; or
|
2011-05-12 08:15:02 -07:00
|
|
|
- configuring Phabricator so it can send mail with
|
|
|
|
@{article:Configuring Outbound Email}; or
|
|
|
|
- configuring inbound mail with @{article:Configuring Inbound Email}; or
|
2012-01-12 18:30:36 -08:00
|
|
|
- importing repositories with @{article:Diffusion User Guide}; or
|
2011-05-12 08:15:02 -07:00
|
|
|
- learning about daemons with @{article:Managing Daemons with phd}; or
|
2012-10-26 12:01:58 -07:00
|
|
|
- configuring backups with @{article:Configuring Backups}; or
|
2012-03-13 19:03:01 -07:00
|
|
|
- contributing to Phabricator with @{article:Contributor Introduction}.
|