Debian Jessie – Webserver nginx php5-fpm

apt-get install nginx php5 php5-fpm php5-mysqlnd

nano /etc/nginx/nginx.conf
user mattionline;
server_tokens off;

nano /etc/php5/fpm/pool.d/www.conf
user = mattionline
group = mattionline
;listen = /var/run/php5-fpm.sock
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1

nano /etc/nginx/php-fpm.conf
location ~ \.(php)$ {
fastcgi_keep_conn on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

nano /etc/nginx/sites-available/default
server {
listen 80;
server_name mattionline.de;
access_log /var/log/nginx/access.log combined;
error_log  /var/log/nginx/error.log;

root /var/www/;
index index.html index.htm index.php;

include php-fpm.conf;
include caching.conf;
autoindex on;
}

nano /etc/nginx/caching.conf
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
}

location ~* \.(?:rss|atom)$ {
expires 1h;
add_header Cache-Control „public“;
}

location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control „public“;
}

location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control „public“;
}

/etc/init.d/nginx restart

#php-fpm socket konnte ich nicht stoppen/neustarten
reboot

chown -R mattionline:mattionline /var/lib/nginx/

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Nach oben scrollen