背景
公司管理需要,為開發團隊尋找一款代碼審查工具,最終選擇了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__=/ /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;
[code]#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
參考:/content/2730031.html
主要是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.靠!!