Answer the question
In order to leave comments, you need to log in
Server optimization for wordpress sites?
After the holidays, I'm going to move to a new server (ssd started to die on the old one).
The old server had the following configuration: Centos 7, nginx+apache+php 5.6.31+opcache in fastcgi mode, MySQL 5.6.30.
This server config was implemented exactly 2 years ago. Tell me, what config is currently relevant for a budget server that hosts 5-10 wordpress sites, and the total traffic is no more than 20k.
Answer the question
In order to leave comments, you need to log in
1) Throw out Apache
2) Switch to Nginx + php7.0-fpm
The Nginx virtual host configuration for WP is something like this:
server {
server_name example.com;
listen 80;
root /home/site1/web;
access_log /home/site1/logs/access.log;
error_log /home/site1/logs/error.log;
index index.php;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
}
location ~ /\.ht {
deny all;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/site1.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
[site1]
user = site1
group = site1
listen = /run/php/site1.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0666
pm = ondemand
pm.max_children = 5
pm.process_idle_timeout = 10s
pm.max_requests = 200
chdir = /
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question