На 12 версии проверенно.
Создаем файл для скачивания nginx
touch /etc/yum.repos.d/nginx.repo
Содержание
cat /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1
Ставим
yum install nginx php-fpm
Правим
/etc/php-fpm.d/www.conf
listen.owner = asterisk
listen.group = asterisk
user = asterisk
group = asterisk
pm = dynamic
m.max_children = 30
pm.start_servers = 3
pm.min_spare_servers = 3
pm.max_spare_servers = 21
pm.max_requests = 1000
Правим
/etc/nginx/nginx.conf
user asterisk;
worker_processes 2;
удаляем конфиг по умолчанию
rm /etc/nginx/conf.d/default.conf
создаем свой
touch /etc/nginx/conf.d/freepbx.conf
содержание
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/localhost.access.log main;
index index.php;
root /var/www/html/;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SERVER_NAME $host;
}
}
Выключаем апатч и включаем nginx
chkconfig httpd off
chkconfig nginx on
chkconfig php-fpm on
service httpd stop
service php-fpm restart
service nginx restart