Get the most out of your Centmin Mod LEMP stack
Become a Member

Wordpress Wordpress Multi-site WPMU

Discussion in 'Blogs & CMS usage' started by Alcides, Sep 30, 2017.

  1. Alcides

    Alcides New Member

    7
    1
    3
    Aug 18, 2017
    Ratings:
    +1
    Local Time:
    7:27 PM
    Hello!

    Please, I would like to know how can I proper setup a "Wordpress Multi-site WPMU" using Centmin.

    I tryied to do that by myself manually but I got several errors...

    Is there a Centmin script option that I can choose to install a "Wordpress Multi-site WPMU" instead of the standard one?

    Thank you in advanced.
     
  2. eva2000

    eva2000 Administrator Staff Member

    37,214
    8,127
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,513
    Local Time:
    7:27 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Like Like x 1
  3. nofun

    nofun New Member

    15
    3
    3
    May 2, 2015
    Latvia
    Ratings:
    +5
    Local Time:
    11:27 PM
    1.9.x
    10.x
    Just to update this topic with my working subdomain WPMU site centminmod beta config:

    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    map $uri $blogname{
        ~^(?<blogpath>/[^/]+/)files/(.*)    $blogpath ;
    }
    map $blogname $blogid {
        default -999;
            include /home/nginx/domains/domain.com/public/wp-content/uploads/nginx-helper/map.conf ;
    }
    
    
    server {
     
      server_name domain.com *.domain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      #add_header X-Content-Type-Options "nosniff" always;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log main_ext buffer=256k flush=60m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
     # include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.com/public;
     
      if (-f $request_filename/index.html){
                    rewrite (.*) $1/index.html break;
        }
     
        if (-f $request_filename/index.php){
                    rewrite (.*) $1/index.php;
        }
    
        if (!-f $request_filename){
                    rewrite (.*) /index.php;
        }
     
       location ~ ^(/[^/]+/)?files/(?<rt_file>.+) {
        try_files /wp-content/blogs.dir/$blogid/files/$rt_file /wp-includes/ms-files.php?file=$rt_file ;
        access_log off;    log_not_found off; expires max;
      }
     
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      # prevent access to ./directories and files
      #location ~ (?:^|/)\. {
      # deny all;
      #}
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Enable for vBulletin usage WITHOUT vbSEO installed
      # More example Nginx vhost configurations at
      # http://centminmod.com/nginx_configure.html
       try_files        $uri $uri/ /index.php?$args ;
    
      }
     
    # Add trailing slash to */wp-admin requests.
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
     
    
    # Pass uploaded files to wp-includes/ms-files.php.
        rewrite /files/$ /index.php last;
    
        if ($uri !~ wp-content/plugins) {
            rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
        }
    
        # Rewrite multisite '.../wp-.' and '.../.php'.
        if (!-e $request_filename) {
            rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
            rewrite ^/[_0-9a-zA-Z-]+.(/wp-admin/.\.php)$ $1 last;
            rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
        }
     
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
    
    and you need two wordpress plugins to install:
    1. WordPress MU Domain Mapping
    2. Nginx Helper
     
    Last edited: Oct 22, 2018
    • Informative Informative x 1
  4. eva2000

    eva2000 Administrator Staff Member

    37,214
    8,127
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,513
    Local Time:
    7:27 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Awesome @nofun thanks for sharing (y)
     
..