0
I need some help please.
I recently decided to migrate my sites
- from Debian 8 + Apache 2.4 + mod_php + Varnish
- to Debian 9 + Nginx + php7.1-fpm + Varnish
I did succesfully migrate a single wordpress installation, it works well. Next I tried to migrate a multisite installation.
- Frontend pages of both Blog1 and Blog2 works just fine.
- But network admin and site admin pages give 500 error.
I used config for subdomains from WP Codex, but I actually use 2 different domains on those 2 blogs.
What I tried:
- Increasing php memory limit to 128 and wp-config memory limit to 64
- Excluding Varnish from the setup
- Adding map {} to nginx conf and WPMU rules from WP Codex
- Disabling plugins and themes
WP-admin of that multisite still unaccesible
1. nginx.conf
user www-data www-data;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_tokens off;
sendfile on;
sendfile_max_chunk 128k;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;
client_header_timeout 3;
client_body_timeout 5;
send_timeout 3;
client_header_buffer_size 2k;
client_body_buffer_size 256k;
client_max_body_size 12m;
access_log off;
include /etc/nginx/conf.d/*.conf;
}
2. frontend.conf
server {
listen 443 ssl;
server_name profispb.com www.profispb.com xn--e1ajhifc2d.xn--p1ai www.xn--e1ajhifc2d.xn--p1ai;
keepalive_timeout 60 60;
gzip on;
gzip_comp_level 1;
gzip_min_length 512;
gzip_buffers 8 64k;
gzip_types text/plain;
gzip_proxied any;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:TLS:2m;
ssl_session_timeout 2m;
ssl_certificate XXXXXXXXXXXXXXXXXXXXXX(hidden);
ssl_certificate_key XXXXXXXXXXXXXXXXXXXXXX(hidden);
#ssl_dhparam /etc/ssl/sslforfree/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_ciphers XXXXXXXXXXXXXXXXXX(hidden)
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains';
location / {
proxy_pass http://127.0.0.1:6081/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
}
}
3. Backend.conf
map $http_host $blogid {
default 0;
xn--e1ajhifc2d.xn--p1ai 1;
profispb.com 2;
}
server {
server_name profispb.com www.profispb.com xn--e1ajhifc2d.xn--p1ai www.xn--e1ajhifc2d.xn--p1ai;
listen 127.0.0.1:81;
root /var/www/vetka/profispb.com;
index index.php;
gzip on;
gzip_comp_level 9;
gzip_min_length 512;
gzip_buffers 8 64k;
gzip_types text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
gzip_proxied any;
location / {
try_files $uri $uri/ /index.php$args;
}
location ~ \.php$ {
try_files $fastcgi_script_name =404;
fastcgi_keep_conn on;
include /etc/nginx/fastcgi_params;
fastcgi_read_timeout 3600s;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
}
#WPMU Files
location ~ ^/files/(.*)$ {
try_files /wp-content/blogs.dir/$blogid/$uri /wp-includes/ms-files.php?file=$1 ;
access_log off; log_not_found off; expires max;
}
#WPMU x-sendfile to avoid php readfile()
location ^~ /blogs.dir {
internal;
alias /var/www/vetka/profispb.com/wp-content/blogs.dir;
access_log off; log_not_found off; expires max;
}
}
Error log sample (repeats)
2017/12/19 22:28:05 [error] 11039#11039: *6 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/vetka/profispb.com/wp-content/plugins/revslider/includes/framework/base-admin.class.php:71
Stack trace:
#0 /var/www/vetka/profispb.com/wp-content/plugins/revslider/admin/revslider-admin.class.php(552): RevSliderBaseAdmin::addMetaBox('Revolution Slid...', '', Array, NULL)
#1 /var/www/vetka/profispb.com/wp-content/plugins/revslider/admin/revslider-admin.class.php(73): RevSliderAdmin->addSliderMetaBox()
#2 /var/www/vetka/profispb.com/wp-content/plugins/revslider/admin/revslider-admin.class.php(44): RevSliderAdmin->init()
#3 /var/www/vetka/profispb.com/wp-content/plugins/revslider/revslider.php(165): RevSliderAdmin->__construct('/var/www/vetka/...')
#4 /var/www/vetka/profispb.com/wp-settings.php(305): include_once('/var/www/vetka/...')
#5 /var/www/vetka/profispb.com/wp-config.php(101): require_once('/var/www/vetka/...')
#6 /var/www/vetka/profispb.com/wp-load.php(37): require_once('/var/www/vetka/...')
#7 /var/www/" while reading response header from upstream, client: 127.0.0.1, server: profispb.com, request: "GET /wp-admin/ HTTP/1.0", upstream: "fastcgi://unix:/run/php/php7.1-fpm.sock:", host: "xn--e1ajhifc2d.xn--p1ai", referrer: "https://xn--e1ajhifc2d.xn--p1ai/"
1You have an error log. What does it say about the 500 response? – Richard Smith – 2017-12-20T11:27:34.543
Hi Richard, I added a sample error block, but don't quite understand it. Can you take a look? (Added to the end of my original message). – Sam Tyurenkov – 2017-12-20T13:49:54.167