Phabricator 安裝

螢幕快照 2013-05-30 上午10.01.07
Phabricator 是 FasceBook 所開發出來的開源軟體 web applications,包含各種專案程式碼控管需要的功能 Review Code,Track Bugs,Browse Source…

接下來開始安裝,本文範例接來自官網使用手冊.

安裝系統需求:

  • git (usually called “git" in package management systems) git
  • Apache (usually “httpd" or “apache2″) (or nginx) web server
  • MySQL Server (usually “mysqld" or “mysql-server") mysql資料庫
  • PHP (usually “php") php5.2以上 包含必需要的extensions
    Required PHP extensions: mbstring, iconv, mysql (or mysqli), curl, pcntl (these might be something like “php-mysql" or “php5-mysql")
    Optional PHP extensions: gd, apc (special instructions for APC are available below if you have difficulty installing it), xhprof (instructions below, you only need this if you are developing Phabricator)

安裝軟體:

1
2
3
4
5
$ cd somewhere/ # pick some install directory
#somewhere 你所安裝的目錄
somewhere/ $ git clone git://github.com/facebook/libphutil.git
somewhere/ $ git clone git://github.com/facebook/arcanist.git
somewhere/ $ git clone git://github.com/facebook/phabricator.git

設定web server:
1.Apache httpd.conf

<VirtualHost *>
  # Change this to the domain which points to your host.
  ServerName phabricator.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 /path/to/phabricator/webroot
 
  RewriteEngine on
  RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
  RewriteRule ^/favicon.ico   -                       [L,QSA]
  RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]
</VirtualHost>
<Directory "/somewhere/phabricator/webroot">
  Order allow,deny
  Allow from all
</Directory>

2.nginx

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;
    }
  }
 
  location /index.php {
    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;
  }
}

3.lighttpd

$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",
    )
}

還需要兩個模組mod_fastcgi,mod_rewrite.

設定好之後開啟瀏覽器瀏覽螢幕快照 2013-05-30 上午10.41.32
依照畫面提示設定mysql.

1
2
3
4
5
6
7
$ cd /somewhere/phabricator/
$ ./bin/config set mysql.host mysql主機
Set 'mysql.host' in local configuration.
$ ./bin/config set mysql.user mysql帳號
Set 'mysql.user' in local configuration.
$ ./bin/config set mysql.pass mysql密碼
Set 'mysql.pass' in local configuration.

再來會出現螢幕快照 2013-05-30 上午10.50.13
依照指示執行,會有提示如有背景需先行關閉.

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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
$ ./bin/storage upgrade
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
 
Loading quickstart template...
Applying patch 'phabricator:db.conpherence'...
Applying patch 'phabricator:db.token'...
Applying patch 'phabricator:db.releeph'...
Applying patch 'phabricator:db.phlux'...
Applying patch 'phabricator:db.phortune'...
Applying patch 'phabricator:db.phrequent'...
Applying patch 'phabricator:db.diviner'...
Applying patch 'phabricator:20130111.conpherence.sql'...
Applying patch 'phabricator:20130127.altheraldtranscript.sql'...
Applying patch 'phabricator:20130201.revisionunsubscribed.php'...
Migrating Differential unsubscribed users to edges...
Done.
Applying patch 'phabricator:20130201.revisionunsubscribed.sql'...
Applying patch 'phabricator:20130131.conpherencepics.sql'...
Applying patch 'phabricator:20130214.chatlogchannel.sql'...
Applying patch 'phabricator:20130214.chatlogchannelid.sql'...
Applying patch 'phabricator:20130214.token.sql'...
Applying patch 'phabricator:20130215.phabricatorfileaddttl.sql'...
Applying patch 'phabricator:20130217.cachettl.sql'...
Applying patch 'phabricator:20130218.updatechannelid.php'...
Updating channel IDs of previous chatlog events...
 
Done.
Applying patch 'phabricator:20130218.longdaemon.sql'...
Applying patch 'phabricator:20130219.commitsummary.sql'...
Applying patch 'phabricator:20130219.commitsummarymig.php'...
Backfilling commit summaries...
Done.
Applying patch 'phabricator:20130222.dropchannel.sql'...
Applying patch 'phabricator:20130226.commitkey.sql'...
Applying patch 'phabricator:20131302.maniphestvalue.sql'...
Applying patch 'phabricator:20130304.lintauthor.sql'...
Applying patch 'phabricator:releeph.sql'...
Applying patch 'phabricator:20130319.phabricatorfileexplicitupload.sql'...
Applying patch 'phabricator:20130319.conpherence.sql'...
Applying patch 'phabricator:20130320.phlux.sql'...
Applying patch 'phabricator:20130317.phrictionedge.sql'...
Applying patch 'phabricator:20130321.token.sql'...
Applying patch 'phabricator:20130310.xactionmeta.sql'...
Applying patch 'phabricator:20130322.phortune.sql'...
Applying patch 'phabricator:20130323.phortunepayment.sql'...
Applying patch 'phabricator:20130324.phortuneproduct.sql'...
Applying patch 'phabricator:20130330.phrequent.sql'...
Applying patch 'phabricator:20130403.conpherencecache.sql'...
Applying patch 'phabricator:20130403.conpherencecachemig.php'...
Migrating data from conpherence transactions to conpherence 'cache'...
 
Done.
Applying patch 'phabricator:20130409.commitdrev.php'...
Migrating differential.revisionPHID to edges...
.
Done.
Applying patch 'phabricator:20130417.externalaccount.sql'...
Applying patch 'phabricator:20130423.updateexternalaccount.sql'...
Applying patch 'phabricator:20130423.phortunepaymentrevised.sql'...
Applying patch 'phabricator:20130423.conpherenceindices.sql'...
Applying patch 'phabricator:20130426.search_savedquery.sql'...
Applying patch 'phabricator:20130502.countdownrevamp1.sql'...
Applying patch 'phabricator:20130502.countdownrevamp2.php'...
Giving countdowns PHIDs
Done.
Applying patch 'phabricator:20130502.countdownrevamp3.sql'...
Applying patch 'phabricator:20130507.releephrqsimplifycols.sql'...
Applying patch 'phabricator:20130507.releephrqmailkey.sql'...
Applying patch 'phabricator:20130507.releephrqmailkeypop.php'...
Populating Releeph requests with mail keys...
Done.
Applying patch 'phabricator:20130508.search_namedquery.sql'...
Applying patch 'phabricator:20130508.releephtransactions.sql'...
Applying patch 'phabricator:20130508.releephtransactionsmig.php'...
Migrating Releeph requests events to transactions...
Done.
Applying patch 'phabricator:20130513.receviedmailstatus.sql'...
Applying patch 'phabricator:20130519.diviner.sql'...
Applying patch 'phabricator:20130521.dropconphimages.sql'...
Applying patch 'phabricator:20130523.maniphest_owners.sql'...
Applying patch 'phabricator:20130524.repoxactions.sql'...
Applying patch 'phabricator:20130529.macroauthor.sql'...
Applying patch 'phabricator:20130529.macroauthormig.php'...
Migrating macro authors...
Done.
Storage is up to date. Use 'storage status' for details.
$

此時回去web再次reload會看到登入畫面.
螢幕快照 2013-05-30 上午10.54.59

再來設定admin 帳號:

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
41
42
$ ./bin/accountadmin
Enter a username to create a new account or edit an existing account.
 
    Enter a username: admin
There is no existing user account 'admin'.
 
 
    Do you want to create a new 'admin' account? [Y/n] Y
 
 
 
    Enter user real name: SDpower
 
 
    Enter user email address: xxx@xxxx
 
 
    Enter a password for this user [blank to leave unchanged]:
 
    Should this user be a system agent? [y/N] y
 
 
 
    Should this user be an administrator? [y/N] y
 
 
 
ACCOUNT SUMMARY
 
               OLD VALUE                        NEW VALUE
    Username                                    admin
   Real Name                                    admin
       Email                                    xxx@xxxx
    Password                                    Updated
System Agent   N                                Y
       Admin   N                                Y
 
 
 
    Save these changes? [Y/n] y
 
Saved changes.

開啟背景

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#系統會提示缺少設定,需先設定
$ ./bin/config set phabricator.base-uri 'http://phabricator.localhost/'
Set 'phabricator.base-uri' in local configuration.
$ ./phd start
Staging launch...
NOTE: Logs will appear in '/var/tmp/phd/log/daemons.log'.
 
Launching 'PhabricatorRepositoryPullLocalDaemon'...
Launching 'PhabricatorGarbageCollectorDaemon'...
Launching 'PhabricatorTaskmasterDaemon'...
Launching 'PhabricatorTaskmasterDaemon'...
Launching 'PhabricatorTaskmasterDaemon'...
Launching 'PhabricatorTaskmasterDaemon'...
Done.
$

One thought on “Phabricator 安裝

發表迴響 取消回覆

你的電子郵件位址並不會被公開。 必要欄位標記為 *