I'm installing Phabricator on CentOS7 using Nginx. I followed the nginx config from their site. When I try to access the url:portpha.mysite.com
in browser, I got File not found
message on browser and found error message in nginx log file :
Error Message in Nginx :
[error] 6433#0: *499 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 223.xxx.xxx.xxx, server: pha.mysite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "pha.mysite.com"
[crit] 6433#0: *499 stat() "/root/pha/phabricator/webroot/favicon.ico" failed (13: Permission denied), client: 223.xxx.xxx.xxx, server: pha.mysite.com, request: "GET /favicon.ico HTTP/1.1", host: "pha.mysite.com", referrer: "http://pha.mysite.com/"
I also checked if php-fpm
is listening on port 9000
:
$ netstat -nap | grep 9000
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 7884/php-fpm: maste
Here is my nginx conf :
server {
listen 80;
server_name pha.mysite.com;
root /root/pha/phabricator/webroot;
location / {
index index.php;
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
}
location = /favicon.ico {
try_files $uri =204;
}
location /index.php {
fastcgi_pass 127.0.0.1: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;
}
}
Here is my php-fpm www.conf snippet :
listen = 127.0.0.1:9000
user = nginx
group = nginx
I've also set 777
for phabricator's webroot :
[root@centos phabricator]# ls -l
... ...
drwxrwxrwx 3 nginx nginx 4096 Nov 12 16:33 webroot
Is there any idea for troubleshooting this problem? Thanks.