【问题标题】:issue with configuring phabricator & nginx配置phabricator和nginx的问题
【发布时间】:2014-04-30 16:47:26
【问题描述】:

我使用来自 phabricator 站点的 install_ubunbu 脚本在 ubuntu 上安装了 phabricator,该脚本似乎已成功运行。我已经在服务器上安装了 MySQL - 我在 default.conf.php 文件中添加了数据库凭据。我也从他们的站点复制了 Nginx 配置。我在端口 82 上添加了一个监听端口。但是,当我尝试在浏览器中访问 url/端口时,我收到以下 Nginx 错误消息(来自 nginx 日志):

错误信息

2014/04/30 12:41:35 [error] 14691#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.xxx.xxx.xxx, server: phabricator.xxxx.com, request: "GET / HTTP/1.1", upstream:
 "fastcgi://127.0.0.1:9000", host: "192.xxx.xxx.xxx:82"

Nginx 配置

server {
       listen 82;  ### 520;
       listen [::]:82;
       server_name phabricator.xxxx.com;

       root /usr/local/phabricator/phabricator/webroot;
       try_files $uri $uri/ /index.php;

       access_log /var/log/nginx/phabricator/access.log;
       error_log /var/log/nginx/phabricator/error.log;

      location / {
                index index.php;

                if ( !-f $request_filename) {
                    rewrite ^/(.*)$ /index.php?__path__=/$1 last;
                    break;
                }
        }

       location ~ .php$ {
           fastcgi_pass localhost:9000;
           fastcgi_index index.php;

           #custom environment variable
           fastcgi_param PHABRICATOR_ENV   "custom/myconfig";  ##change this

           #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;
   }
}

任何有关解决此问题的想法或我是否需要按照其他步骤设置 phabricator 将不胜感激。

【问题讨论】:

  • pilot 错误 - php5-fpm 没有在 9000 上监听 - 我使用的是 php5-fpm.sock。

标签: php nginx phabricator


【解决方案1】:

这是试点错误 - php5-fpm 没有在 9000 上监听,因为我使用的是 php5-fpm.sock(在 /etc/php5/fpm/pool.d/ 中配置)

【讨论】:

  • 那我该如何解决呢?
  • 您是否在 phabricator 前面运行 nginx - 如果是,您是否使用 php5-fpm,如果是,您是否使用 php5-fpm.sock?
  • 我发现,在我的情况下,php-fpm 没有运行,所以我必须执行 sudo service php-fpm start,这解决了我的问题。
  • @user2002692 如果您像我一样一直在听 php5-fpm.sock,您可以通过编辑 /etc/php5/fpm/pool.d/www.conf 并注释掉 listen = /var/run/php5-fpm.sock 来修复它.将其替换为 listen = 9000,保存、关闭并重新启动 php5-fpm。然后,您可以通过 netstat -na | grep 9000 检查它是否正在侦听端口 9000
猜你喜欢
  • 2014-06-17
  • 2020-03-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-06-03
  • 1970-01-01
  • 2012-03-17
相关资源
最近更新 更多