1,首先要有管理員權限,點擊moreAppritions進入Calendar,點擊install提示說沒有權限那就添加權限
2,添加權限之後提示設置habricator.show-prototypes
3,進入phabricator的bin目錄下面執行./bin/config set phabricator.show-prototypes true
4,然後可以使用
參考博客:http://angelo-chan.github.io/2016/04/06/Phabricator%E8%BF%9B%E9%98%B6/
安裝額外依賴包
1
|
$ apt-get install python-pygments imagemagick
|
創建賬號
1
2
3
|
$ useradd -d /home/phd phd
$ useradd -G sudo phd
$ useradd git
|
上面可以不用創建phd賬號,直接用存在的賬號
檢查/etc/passwd中的git
1
|
git:x:1001:1001:,,,:/home/git:/bin/bash
|
檢查/etc/shadow中的git項
1
|
git:NP:16896:0:99999:7:::
|
創建repo目錄
1
2
|
$ mkdir /var/repo
$ chown -R phd:phd /var/repo
|
安裝Phabricator
1
2
3
4
|
su phd
cd /home/phd
wget http://www.phabricator.com/rsrc/install/install_ubuntu.sh
bash install_ubuntu.sh
|
如果沒有install_ubuntu.sh,可以點擊鏈接訪問
推薦配置
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
|
$ ./bin/config set mysql.user <MYSQL_ROOT_USER>
$ ./bin/config set mysql.pass <MYSQL_ROOT_PASSWD>
$ ./bin/config set mysql.host 127.0.0.1
$ ./bin/storage upgrade
$ ./bin/config set phabricator.base-uri 'http://phabricator.mydomain.net/'
$ ./bin/config set phd.user phd
$ ./bin/config set environment.append-paths '["/usr/lib/git-core"]'
$ ./bin/config set diffusion.ssh-user git
$ ./bin/config set pygments.enabled true
# for local-disk file storage only:
$ mkdir /var/phabricator-files
$ chown www-data /var/phabricator-files
$ ./bin/config set storage.local-disk.path /var/phabricator-files
# Set true if you want to allow public http cloning:
$ ./bin/config set policy.allow-public true
# Set to true if you want to allow http pushes
$ ./bin/config set diffusion.allow-http-auth false
# You most likely want prototype apps, they are very useful:
$ ./bin/config set phabricator.show-prototypes true
# You may want this true, depending on your workflow:
$ ./bin/config set differential.require-test-plan-field false
# recommended silliness-enabling settings:
$ ./bin/config set files.enable-imagemagick true
$ ./bin/config set remarkup.enable-embedded-youtube true
|
修改/etc/sudoers
1
2
|
git ALL=(phd) SETENV: NOPASSWD: /usr/bin/git-upload-pack, /usr/bin/git-receive-pack
www-data ALL=(phd) SETENV: NOPASSWD: /usr/lib/git-core/git-http-backend
|
配置Apache
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
|
# cat /etc/apache2/sites-available/phabricator.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName phabricator.mydomain.net
ServerAlias phabricator.mydomain.net
ServerAdmin [email protected]
DocumentRoot /home/phd/phabricator/webroot
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
<Directory "/home/phd/phabricator/webroot">
Require all granted
</Directory>
</VirtualHost>
$ a2dissite 000-default
$ a2ensite phabricator
$ service apache2 restart
|
配置mysql
1
2
3
4
5
6
7
8
9
10
11
|
# /etc/mysql/my.cnf under the [mysqld] heading:
sql_mode=STRICT_ALL_TABLES
ft_boolean_syntax=' |-><()~*:""&^'
ft_stopword_file=/home/phd/phabricator/resources/sql/stopwords.txt
ft_min_word_len=3
#should be about 40% of the memory of the box:
innodb_buffer_pool_size=800M
max_allowed_packet = 32M
$ service restart mysql
|
配置PHP
1
2
3
4
5
|
#in `/etc/php5/apache2/php.ini`
post_max_size = 8M
date.timezone = Asia/Shanghai
opcache.validate_timestamps=0
$ service apache2 restart
|
開啓Phabricator Daemon
開啓SSH Clone And Push
修改SSHD Port 爲2222
1
2
3
|
$ vim /etc/ssh/sshd_config
# restart sshd service
$ service sshd restart
|
Make executable ssh hook for phabricator ssh daemon
1
2
3
4
5
6
|
# copy ssh hook to executable location
$ cp /home/phd/phabricator/resources/sshd/phabricator-ssh-hook.sh /usr/lib/phabricator-ssh-hook.sh
$ chown root /usr/lib/phabricator-ssh-hook.sh
$ chmod 755 /usr/lib/phabricator-ssh-hook.sh
# Modify hook to match your system (hint: vcs-user == git)
$ vim /usr/lib/phabricator-ssh-hook.sh
|
Create phabricator ssh daemon on port 22
1
2
3
4
5
6
|
# Copy the examply sshd config
$ cp /home/phd/phabricator/resources/sshd/sshd_config.phabricator.example /etc/ssh/sshd_config.phabricator
# Edit AuthorizedKeysCommand, AuthorizedKeysCommandUser, and AllowUsers
$ vim /etc/ssh/sshd_config.phabricator
# Start the phabricator sshd
$ /usr/sbin/sshd -f /etc/ssh/sshd_config.phabricator
|
測試:
你應該得到:
1
|
{"result":"orbital","error_code":null,"error_info":null}
|
https://secure.phabricator.com/book/phabricator/article/installation_guide/