配置Phabricator和Nginx

时间:2017-01-25 14:40:39

标签: nginx phabricator

所以我试图在本地安装phabricator来玩它,看看它是否符合我的需要。我一直在关注安装和配置documentation。我正在运行Ubuntu 16.04 x64。

安装脚本的输出是

Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  php7.0-cli:i386 php7.0-cli

Package php5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-mysql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-gd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php-apc is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php5' has no installation candidate
E: Package 'php5-mysql' has no installation candidate
E: Package 'php5-gd' has no installation candidate
E: Package 'php5-dev' has no installation candidate
E: Unable to locate package php5-curl
E: Package 'php-apc' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Unable to locate package php5-json
sudo: a2enmod: command not found
pcntl already installed
Cloning into 'libphutil'...
remote: Counting objects: 14639, done.
remote: Total 14639 (delta 0), reused 0 (delta 0), pack-reused 14639
Receiving objects: 100% (14639/14639), 7.91 MiB | 2.50 MiB/s, done.
Resolving deltas: 100% (8659/8659), done.
Checking connectivity... done.
Cloning into 'arcanist'...
remote: Counting objects: 17668, done.
remote: Total 17668 (delta 0), reused 0 (delta 0), pack-reused 17668
Receiving objects: 100% (17668/17668), 6.50 MiB | 1.27 MiB/s, done.
Resolving deltas: 100% (10897/10897), done.
Checking connectivity... done.
Cloning into 'phabricator'...
remote: Counting objects: 221159, done.
remote: Compressing objects: 100% (188/188), done.
remote: Total 221159 (delta 87), reused 0 (delta 0), pack-reused 220969
Receiving objects: 100% (221159/221159), 119.27 MiB | 5.39 MiB/s, done.
Resolving deltas: 100% (147990/147990), done.
Checking connectivity... done.


Install probably worked mostly correctly. Continue with the 'Configuration Guide':

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

You can delete any php5-* stuff that's left over in this directory if you want.

我安装了php7.0和php-fpm7.0。

nginx.conf

# Phabricator
server {
       listen 82;
       server_name localhost;
       root        /home/shatnerz/phabricator/phabricator/webroot/;

       location / {
                 index index.php;
                 rewrite ^/(.*)$ /index.php?__path__=/$1 last;
        }

        location /index.php {
                 fastcgi_pass   localhost:9000;
                 fastcgi_index   index.php;

                 #required if PHP was built with --enable-force-cgi-redirect
                 fastcgi_param  REDIRECT_STATUS    200;

                 #variables to make the $_SERVER populate in PHP
                 fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
                 fastcgi_param  QUERY_STRING       $query_string;
                 fastcgi_param  REQUEST_METHOD     $request_method;
                 fastcgi_param  CONTENT_TYPE       $content_type;
                 fastcgi_param  CONTENT_LENGTH     $content_length;

                 fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;

                 fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
                 fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

                 fastcgi_param  REMOTE_ADDR        $remote_addr;
        }
}

当我尝试访问http://localhost:82/时,我得到502 Bad Gateway。我的nginx / error.log显示

2017/01/25 09:15:16 [error] 13746#13746: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:82"
2017/01/25 09:15:16 [error] 13746#13746: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:82", referrer: "http://localhost:82/"

1 个答案:

答案 0 :(得分:2)

看起来我必须编辑/etc/php/7.0/fpm/pool.d/并设置

listen = /run/php/php7.0-fpm.sock

listen = 9000