Phabricator搭建

来源:互联网 发布:福利狗电视直播软件 编辑:程序博客网 时间:2024/05/21 10:25

最近一直想搭建一个代码审查的系统,最后选了Phabricator。Phabricator这个软件就不多介绍了,直接切入主题。
1.系统选择CentOS6.5,当然也可以在windows上安装(本人未尝试过),个人觉得毕竟多数开源软件都是基于Linux来的,所以建议还是在Linux上部署,可以避免很多不必要的麻烦。
查看系统版本命令lsb_release -a
官方解释:
Phabricator是一个LAMP应用套件,因此最基本的要求就是LAMP环境:
• Linux:Linux的不同发行版及变种是必需的。Mac OS X是一个可接受的Linux变种,Windows不是。Phabricator不能安装在Windows系统上。在Mac OS X,Amazon Linux,Ubuntu,RHEL和CentOS上运行的Phabricator有活跃的贡献者;如果你运行在其他的Linux发行版上,请发送补丁或 投诉。
• Apache(或nginx,或lighttpd):需要Apache 2.2.7以上版本。
• MySQL:MySQL必需
• PHP:需要PHP5.2以上版本
注意:Phabricator的命令行接口–Arcanist,可以在Windows上正常运行。查看详细说明Aranist使用教程:Windows(官方页面:Arcanist User Guide: Windows)。
你可能也需要一个域名和一台能连接互联网的电脑。
2.下载安装脚本install_rhel-derivs.sh:https://secure.phabricator.com/F1197551 ,如果是ubuntu请选择对应的脚本。
3.创建安装目录为/opt/code_review(可自定义),拷贝文件install_rhel-derivs.sh文件该目录下sh install_rhel-derivs.sh即可完成安装(前提是要保证有外网,如果安装过程中因网络原因安装失败可多尝试几次)。安装完成目录结构如下:
这里写图片描述
4.配置mysql(安装脚本已自动安装)
a.启动mysql:/etc/init.d/mysqld start
b.设置密码(默认安装没设置密码)
mysql
use mysql
这里写图片描述

update user set password=password(‘root’) where user=’root’;
通过以上语句可以修改密码,因为mysql有授权机制如果要在其他客服端访问该数据库需要授权:GRANT ALL PRIVILEGES ON . TO ‘root’@’ip地址’ IDENTIFIED BY ‘root’ WITH GRANT OPTION;
exit;
c.导入phabricator库到mysql
cd /opt/code_review/phabricator/phabricator(你的安装目录)
./storage upgrade
至此已完成mysql配置。
5.配置apache(默认安装的是2.2版本的)
a.查看版本 /usr/sbin/apachectl -v
b.vi /etc/httpd/conf/httpd.conf在配置文件底部添加如下内容:

<VirtualHost *>  # Change this to the domain which points to your host.  ServerName localhost  # 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 /opt/code_review/phabricator/phabricator/webroot  RewriteEngine on  RewriteRule ^/rsrc/(.*)     -                       [L,QSA]  RewriteRule ^/favicon.ico   -                       [L,QSA]  RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]</VirtualHost>

c.启动服务 /etc/init.d/httpd start,如果启动有需要修改httpd.conf文件中“#ServerName www.xxxxx.com:80”改称 “ServerName localhost”

备注:之前用CentOS7但是yum 库上没有完整的包,需要手动安装,但是由于各种问题未能成功,所以选择了CentOS6.5,安装过程可能有很多报错,希望该文档对大家有帮助。

0 0
原创粉丝点击