facebook代码review工具-phabricator安装步骤

钱青青
2023-12-01

参考文档链接地址:

phabricator.org

http://www.tecmint.com/install-phabricator-in-linux/


LAMP环境包含以下四个方面:

Linux Apache MySQL php


首先要安githttp://www.cnblogs.com/perseus/archive/2012/01/06/2314069.html

安装语句:sudoapt-get install git


安装步骤记录:
step1:Installing Required Components
sudo apt-get install mysql-server apache2 git-core git php5 php5-mysql php5-gd php5-curl php-apc php5-cli -y

---info beginning---
* Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[ OK ]
---info end---

echo "ServerName code-lenovo" | sudo tee /etc/apache2/conf-available/fqdn.conf

sudo a2enconf fqdn
service apache2 reload


step2:Downloading Phabricator Files
sudo mkdir /var/www/myproject

sudo chown -R code:www-data /var/www

cd /var/www/myproject/

git clone https://github.com/phacility/libphutil.git

git clone https://github.com/phacility/arcanist.git

git clone https://github.com/phacility/phabricator.git

step3:Configure Apache for Phabricator
sudo a2enmod rewrite

sudo a2enmod ssl

sudo /etc/init.d/apache2 restart

sudo gedit /etc/apache2/sites-available/phabricator.conf

############################################################
<VirtualHost *:80>
ServerAdmin root@phab.yourexample.com
ServerName phab.yourexample.com
DocumentRoot /var/www/myproject/phabricator/webroot
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
<Directory "/var/www/myproject/phabricator/webroot">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
############################################################


sudo a2ensite phabricator.conf

service apache2 reload

sudo /etc/init.d/apache2 restart

step4:Configure MySQL for Phabricator
cd /var/www/myproject/phabricator/

./bin/config set mysql.host localhost

./bin/config set mysql.user root

./bin/config set mysql.pass ***      //( password)

./bin/storage upgrade --user root --password ***     //( password)

sudo service mysql restart

sudo gedit /etc/apache2/httpd.conf

#########################################################
<VirtualHost *>
# Change this to the domain which points to your host.
ServerName phab.code206a.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 /var/www/myproject/phabricator/webroot

DocumentRoot /var/www/html
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]

<Directory /var/www/myproject/phabricator/webroot>
Require all granted
</Directory>

</VirtualHost>


########################################################

step5:Configuring Phabricator Web UI
http://phab.yourexample.com/

##---If the above admin setup page is not displayed we need to create admin login manually from the terminal.

./bin/accountadmin


Step 6:

sudo gedit /etc/hosts

############################################
xx.xx.xx.xx phab.yourexample.com
127.0.1.1 code-Lenovo

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


###############################


sudo /etc/init.d/networking restart


每次使用时需要打开文件地址,开启服务,唤醒账户:
cd /var/www/myproject/phabricator

sudo service mysql restart

sudo service apache2 restart

./bin/auth recover code


mysql STRICT_ALL_TABLES 错误如何解决?
1.先卸载掉mysql-server
sudo apt-get autoremove --purge mysql-server-5.5 //----这一步必须做

sudo apt-get remove mysql-server //选做

sudo apt-get autoremove mysql-server //选做

sudo apt-get remove mysql-common //----这一步必须做

2.再次安装mysql-server,命令里含有之前安装过的程序,没有卸载的不会再次安装
sudo apt-get install mysql-server apache2 git-core git php5 php5-mysql php5-gd php5-curl php-apc php5-cli -y

mysqld文件夹下mysqld的路径需要更改为自己socket 和pid的路径,在my.cnf文件里
添加一句 sql-mode=STRICT_ALL_TABLES 


Phabricator邮件收发问题:
Phabricator用的是sendmail来发邮件,服务器是ubuntu系统。

首先要安装sendmail,命令为下:
sudo apt-get install sendmail
然后配置mail和PHPMailer。

配置mail:通过web访问phabricator并在页面上进行配置:(这里使用的是外部SMTP server的方式,更多方式参见phabricator docs)
用administrator账号登录后,在administration栏选择Config进入
1)选择mail,设置:
metamta.default-address -- xxxx@qq.com // 注意:这里必须要用与smtp服务器对应的邮箱地址,不然邮件发不出去
metamta.domain -- phabricator.myproject.com // 随意
metamta.mail-adapter: set to "PhabricatorMailImplementationPHPMailerAdapter"
metamta.reply-handler-domain: phabricator.myproject.com
metamta.send-immediately: Send Via Daemons
2)选择PHPMailer,设置:(以qq.com的SMTP server为例)
phpmailer.mailer: set to "smtp".
phpmailer.smtp-host: smtp.qq.com
phpmailer.smtp-protocol: SMTP
phpmailer.smtp-port: 25
phpmailer.smtp-user: xxxx
phpmailer.smtp-password: xxxx

要记得把 send-immediately改成false,这样表示使用daemon进行异步发送。其他的domain 和address之类的自己随便写无所谓。
我的ph是不会自动启动daemon的,需要手动执行 ./bin/phd start


 类似资料: