Ставлю nginx и php с такими USE-флагами:
Код: Выделить всё
[ebuild R ] www-servers/nginx-1.7.4 USE="http http-cache pcre ssl vim-syntax -aio -debug -ipv6 -libatomic -luajit -pcre-jit -rtmp (-selinux)" NGINX_MODULES_HTTP="access auth_basic autoindex fastcgi gunzip gzip gzip_static memcached perl rewrite scgi -addition -ajp -auth_pam -auth_request -browser -cache_purge -charset -dav -dav_ext -degradation -echo -empty_gif -fancyindex -flv -geo -geoip -headers_more -image_filter -limit_conn -limit_req -lua -map -metrics -mogilefs -mp4 -naxsi -proxy -push_stream -random_index -realip -referer -secure_link -security -slowfs_cache -spdy -split_clients -ssi -sticky -stub_status -sub -upload_progress -upstream_check -upstream_ip_hash -userid -uwsgi -xslt" NGINX_MODULES_MAIL="-imap -pop3 -smtp"
[ebuild R ] dev-lang/php-5.5.16:5.5 USE="bzip2 cgi cli crypt ctype curl fileinfo filter fpm gd gdbm hash iconv json nls opcache phar posix readline session simplexml sqlite ssl tidy tokenizer unicode xml zip zlib -apache2 -bcmath -berkdb -calendar -cdb -cjk -debug -embed -enchant -exif (-firebird) -flatfile (-frontbase) -ftp -gmp -imap -inifile -intl -iodbc -ipv6 -kerberos -ldap -ldap-sasl -libedit -libmysqlclient -mhash -mssql -mysql -mysqli -oci8-instant-client -odbc -pcntl -pdo -postgres -qdbm -recode (-selinux) -sharedmem -snmp -soap -sockets -spell (-sybase-ct) -systemd -sysvipc -threads -truetype -vpx -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xslt"
Создаю каталог, где размещаю нужное мне содержимое:
Код: Выделить всё
$ ls -lR /home/www/probe/
/home/www/probe/:
итого 8
drwxr-xr-x 2 nginx nginx 4096 окт 9 20:47 images
drwxr-xr-x 2 nginx nginx 4096 окт 10 16:43 www
/home/www/probe/images:
итого 120
-rw-r--r-- 1 nginx nginx 119255 окт 9 20:47 wot.jpg
/home/www/probe/www:
итого 8
-rw-r--r-- 1 nginx nginx 110 окт 9 20:48 index.html
-rwxr-xr-x 1 nginx nginx 23 окт 10 16:43 index.php
$ cat /home/www/probe/www/index.php
<?
php phpinfo();
?>
Пишу конфиг для nginx:
Код: Выделить всё
$ cat /etc/nginx/nginx.conf
user nginx;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;
server {
index index.php;
location / {
root /home/www/probe/www;
}
location /images/ {
root /home/www/probe/;
}
location ~ \.php$ {
root /home/www/probe/www;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/probe/www/$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 REDIRECT_STATUS 200;
}
}
}
Проверяю, какой слушается fcgi-сокет:
Код: Выделить всё
$ grep fpm.sock /etc/php/fpm-php5.5/php*
/etc/php/fpm-php5.5/php-fpm.conf:listen = /var/run/php5-fpm.sock
Рестартую демоны php-fpm и nginx, открываю в огнелисе страницу с localhost и вижу там 502 Bad Gateway.
Открываю логи нжинкса и вижу такое:
Код: Выделить всё
2014/10/10 20:02:04 [crit] 14140#0: *6 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "localhost"
Гугл меня уже в лицо узнает, ошибок подобных - куча, но вот решения не помогают.
Подскажите, в каком месте грабли?