(ОС: Debian 5.0)
Устанавливаем Nginx, PHP
apt-get install nginx php5-common php5-cli php5-cgi php5-mysql gcc make
Собираем Spawn-fcgi:
cd /usr/src
wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz
tar -xf spawn-fcgi-1.6.3.tar.gz
cd spawn-fcgi-1.6.3
./configure --prefix=/opt/spawn-fcgi
make install
Создаем Init скрипт /etc/init.d/spawn-fcgi
#!/bin/bash case "$1" in start) echo "starting..." /opt/spawn-fcgi/bin/spawn-fcgi -U www-data -G www-data -p 9000 -F 2 -C 3 -f php-cgi ;; stop) echo "stopping..." killall php-cgi ;; restart) echo "restarting..." killall php-cgi sleep 1 /opt/spawn-fcgi/bin/spawn-fcgi -U www-data -G www-data -p 9000 -F 2 -C 3 -f php-cgi ;; *) echo "Usage: $0 [start|stop|restart]" esac exit
Выставляем права и добавляем его в автозагрузку
chmod 700 /etc/init.d/spawn-fcgi update-rc.d spawn-fcgi defaults
В /etc/nginx/sites-enabled/default расскоментируем и корректируем часть конфига
location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name; include fastcgi_params; }
Запускаем Spawn-fcgi, Nginx
invoke-rc.d spawn-fcgi start invoke-rc.d nginx start
Комментариев нет:
Отправить комментарий