phabricator 搭建

os:debian7

Installation Guide :https://secure.phabricator.com/book/phabricator/ 

$ cd /data  # 安装目录
data/ $ git clone git://github.com/facebook/libphutil.git
data/ $ git clone git://github.com/facebook/arcanist.git
data/ $ git clone git://github.com/facebook/phabricator.git

1.Phabricator是一个LAMP应用套件,最基本的要求是LAMP环境

#!/bin/bash

confirm() {
  echo "Press RETURN to continue, or ^C to cancel.";
  read -e ignored
}

GIT='git'

LTS="Debian 7.8"
ISSUE=`cat /etc/issue`
if [[ $ISSUE != Debian* ]]
then
  echo "This script is intended for use on Debian, but this system appears";
  echo "to be something else. Your results may vary.";
  echo
  confirm
elif [[ `expr match "$ISSUE" "$LTS"` -eq ${#LTS} ]]
then
  GIT='git-core'
fi

echo "PHABRICATOR Debian INSTALL SCRIPT";
echo "This script will install Phabricator and all of its core dependencies.";
echo "Run it from the directory you want to install into.";
echo

ROOT=`pwd`
echo "Phabricator will be installed to: ${ROOT}.";
confirm

echo "Testing sudo..."
sudo true
if [ $? -ne 0 ]
then
  echo "ERROR: You must be able to sudo to run this script.";
exit 1;
fi;

echo "Installing dependencies: git, apache, mysql, php...";
echo

set +x

#sudo apt-get -qq update
sudo apt-get update
sudo apt-get install 
  $GIT mysql-server apache2 
  php5 php5-mysql php5-gd php5-dev php5-curl php-apc php5-cli php5-json

# Enable mod_rewrite
sudo a2enmod rewrite

HAVEPCNTL=`php -r "echo extension_loaded('pcntl');"`
if [ $HAVEPCNTL != "1" ]
then
  echo "Installing pcntl...";
  echo
  apt-get source php5
  PHP5=`ls -1F | grep '^php5-.*/$'`
  (cd $PHP5/ext/pcntl && phpize && ./configure && make && sudo make install)
else
  echo "pcntl already installed";
fi

if [ ! -e libphutil ]
then
  git clone https://github.com/phacility/libphutil.git
else
  (cd libphutil && git pull --rebase)
fi
if [ ! -e arcanist ]
then
  git clone https://github.com/phacility/arcanist.git
else
  (cd arcanist && git pull --rebase)
fi

if [ ! -e phabricator ]
then
  git clone https://github.com/phacility/phabricator.git
else
  (cd phabricator && git pull --rebase)
fi

echo
echo
echo "Install probably worked mostly correctly. Continue with the 'Configuration Guide':";
echo
echo "    https://secure.phabricator.com/book/phabricator/article/configuration_guide/";
echo
echo "You can delete any php5-* stuff that's left over in this directory if you want.";

为方便以后使用,mysql设置root密码为空(擦除密码后记得去掉skip-grant-tables)

/etc/mysql/my.cnf
[mysqld]字段中加上一句:skip-grant-tables后重启mysql
$mysql
mysql> USE mysql ; 
mysql> UPDATE user SET Password = password ( 'new-password' ) WHERE User = 'root' ; 
mysql> flush privileges ;

测试Apache,使用一个测试页来验证其是否正常工作。

2.apache配置: 

xc@phabrictor:/etc/apache2/sites-enabled$ cat myphabricator
<VirtualHost *:80>
        ServerName myphabricator.example.com
#        ServerName phabricator.example.com
        DocumentRoot "/data/phabricator/webroot"

        <Directory "/data/phabricator/webroot"> 
                Order allow,deny
                Allow from all
        </Directory>

        RewriteEngine on
        RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
        RewriteRule ^/favicon.ico   -                       [L,QSA]
        RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]
</VirtualHost>

 mysql配置:

[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
sql-mode=STRICT_ALL_TABLES
skip-external-locking
ft_stopword_file=/data/phabricator/resources/sql/stopwords.txt
ft_boolean_syntax=' |-><()~*:""&^'
ft_min_word_len=3

php:

xc@phabricator:/data/phabricator$ ./bin/phd restart    #每次改动此目录下的内容都要restart php守护进程来生效

  phabricator/ $ ./bin/storage upgrade

  phabricator/ $ ./bin/storage upgrade --force   #每当Phabricator进行了更新,都需要运行storage upgrade

3.登陆myphabricator.example.com页面。会出现管理员注册界面,按照提示填写管理员的真实信息、解决issues.

4.界面配置邮件Config->Mail

metamta.default-address  发件人(如xc@myphab.example.com)

metamta.domain     #myphab.example.com

metamta.mail-adapter : PhabricatorMailImplementationPHPMailerAdapter

phpmailer 配置:

原文地址:https://www.cnblogs.com/clovn/p/5103611.html