【ubuntu 18.04】安装apache2+php7+phabricator环境

1. 官网文档

https://secure.phabricator.com/book/phabricator/article/configuration_guide/

2. 安装apache2

sudo apt-get install dpkg-dev 
sudo apt-get install apache2

3. 安装php7.2及支持扩展

sudo apt-get install php php-mysql php-gd php-curl php-apcu php-cli php-json php-mbstring
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.2-fpm
sudo systemctl reload apache2

4. 安装mysql5.7

sudo apt-get install mysql-server 

5. 安装git

sudo apt-get install git

6. 拉取项目

cd ~
# git clone https://github.com/phacility/libphutil.git # 新版不需要 git clone https://github.com/phacility/arcanist.git git clone https://github.com/phacility/phabricator.git

7. 配置Apache配置

sudo vim /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *>
        # 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 www.example.com

        # ServerAdmin webmaster@localhost
        ServerName localhost:9999
        DocumentRoot /home/master/phabricator/phabricator/webroot

        # 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
        RewriteEngine on
        RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]

        <Directory "/home/master/phabricator/phabricator/webroot">
          Require all granted
        </Directory>

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

sudo vim /etc/apache2/ports.conf

改下默认端口, 因为我的80已经被使用

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 9999

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

8. 重启服务生效配置

sudo systemctl reload apache2
sudo systemctl start apache2
# 如果有报错, 可以用下面提示命令查看服务报错原因
journalctl -xe

9. 访问http://127.0.0.1:9999/ 初始化配置


# 配置数据库
sudo ./bin/config set mysql.host 127.0.0.1
sudo ./bin/config set mysql.user root
sudo ./bin/config set mysql.pass 123456
# 初始化数据库
sudo ./bin/storage upgrade

10. 设置初始管理员账号

11. 启动认证 Username/Password

12. 重新注册用户

【ubuntu 18.04】安装apache2+php7+phabricator环境

 

 手动修改数据库isAprroved为1即可登录

 

 

问题1:管理员设置后,注销了,有没启用认真和注册功能,怎么重新登录

./bin/auth recover admin

 

上一篇:P7567 「MCOI-05」魔仙


下一篇:路由重定向