背景
公司管理需要,为开发团队寻找一款代码审查工具,最终选择了Phabricator。
ubuntu14.04 LTS
安装
使用官网上提供的install.sh即可。参考链接:
https://secure.phabricator.com/diviner/find/?name=Installation_Guide&type=article&jump=1
Apache2.4
暂未搞定
Nginx
https://secure.phabricator.com/book/phabricator/article/configuration_guide/ 提供了Nginx的配置。感觉比Apache简单很多。
但是安装完之后就出错了。报错是111.
2016/05/08 01:59:21 [error] 27345#0: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: ph.cgh.com, request: “GET /info.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “ph.cgh.com”
百度了下初步判定为Nginx和PHP之间需要有一个php-fpm。参考了如下文档:
https://www.howtoforge.com/installing-nginx-with-php5-fpm-and-mysql-on-ubuntu-14.04-lts-lemp
主要内容是:
-安装php5-fpm:apt-get install php5-fpm
-配置Nginx,修改之前所提官网上Nginx配置如下:
“`python
server {
server_name ph.cgh.com;
root /home/chang/phabricator/webroot;
location / {
index index.php;
rewrite ^/(.*)/index.php?__path__=/1 last;
}
location = /favicon.ico {
try_files $uri =204;
}
location /index.php {
# fastcgi_pass localhost:9000;
# fastcgi_index index.php;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
#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;
}
}
其中主要调整的是
“`python
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
然后server的配置应该写在http中。
nginx的配置文件在/etc/nginx/nginx.conf
待续
CENTOS 6 安装Nginx
参考:http://shmily2038.iteye.com/blog/1860063
主要是centos直接yum装nginx总是提示:Nothing to do
然后参考上文,先执行了
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
之后yum install nginx搞定。
php-fpm
注意这里yum install php-fpm而不是php5.靠!!