Сб. Апр 27th, 2024

Для начала добавляем след.репозитории в /etc/apt/sources.list:

deb http://packages.dotdeb.org stable all deb-src http://packages.dotdeb.org stable all
deb http://php53.dotdeb.org stable all
добавим его ключ:
wget -q -O - http://www.dotdeb.org/dotdeb.gpg | apt-key add -

Затем ставим сам Nginx
apt-get install nginx
правим дефолтный конфиг /etc/nginx/sites-available/default

server {

listen   80;

server_name  localhost;

access_log  /var/log/nginx/localhost.access.log;

 ## Default location

location / {

root   /var/www;

index  index.php;

}

 ## Images and static content is treated different

location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {

access_log        off;

expires           30d;

root /var/www;

}

 ## Parse all .php file in the /var/www directory

location ~ .php$ {

fastcgi_split_path_info ^(.+\.php)(.*)$;

fastcgi_pass   backend;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;

include fastcgi_params;

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_intercept_errors        on;

fastcgi_ignore_client_abort     off;

fastcgi_connect_timeout 60;

fastcgi_send_timeout 180;

fastcgi_read_timeout 180;

fastcgi_buffer_size 128k;

fastcgi_buffers 4 256k;

fastcgi_busy_buffers_size 256k;

fastcgi_temp_file_write_size 256k;

}

 ## Disable viewing .htaccess & .htpassword

location ~ /\.ht {

deny  all;

}

}

upstream backend {

server 127.0.0.1:9000;

}

теперь PHP

apt-get install php5-cli php5-common php5-suhosin

apt-get install php5-fpm php5-cgi

Теперь правим /etc/php5/fpm/php.ini:

находим и меняем short_open_tags на On

 

от RUSUA

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Анти-спам: выполните заданиеWordPress CAPTCHA