C4f1151075b447779af31e99d6cf70e2c6eb47ac
By:
newbie

Installing wordpress multi-site on new version of wordpress

May 11, 2017 747 views
WordPress Nginx Ubuntu 16.04

@jtittle
i know u posted a comment on my earlier post, but dont for some reason i cant see that comment. i also tried to copy the link from your profile but no luck.

anyways,
now i have wordpress multi-site on subdomain. completely working so far. and i uploaded an image for test on my new site, and found that blogs.dir is now sites inside wp-content/uploads

now my question is, from wordpress codex, these seems pretty important if you are concern about performance.

map $http_host $blogid {
        default               0;
        www.mysite.com           1;
        subdomain.mysite.com     2;
}

        location ~ ^/files/(.*)$ {
                try_files /wp-content/upload/sites/$blogid/$uri /wp-includes/ms-files.php?file=$1;
                access_log off; log_not_found off;
        }

        location ^~ /sites {
                internal;
                alias /var/www/novoapp/html/wp-content/sites;
                access_log off; log_not_found off;
        }

        location ~* /(?:uploads|files)/.*\.php$ {
                deny all;
        }

as you can see, i changed blogs.dir folder name and location accurately but my question is, does all these still required? or im just wasting time on some deprecated stuffs here.

by the way, i also removed following lines from server block as im not on sub-directory anymore. i hope that ok.

       if ( !-e $request_filename ) {
               rewrite /wp-admin$ $scheme://$host$uri/ permanent;
               rewrite ^(/[^/]+)?(/wp-.*) $2 last;
               rewrite ^(/[^/]+)?(/.*\.php) $2 last;
       }

and thanks a lot my friend for all the help. you are really amazing.

1 Answer
jtittle1 May 11, 2017
Accepted Answer

@newbie

It's slightly odd as I can't see my response either :-).

The main part of the reply is that on newer installations, blogs.dir does not exist and WordPress now uses /wp-content/uploads.

This happened as of v3.5, so any installation turned network on 4.x won't use or have blogs.dir, so any rewrites targeting that directory won't work either. From the looks of it, that page needs updating so that the new setup matches their guide.

...

In terms of performance, I've never noticed a performance hit without mapping.

When testing the site I setup to confirm the previous rewrites, load times were 0.7-1.0s from a location in Canada to the Droplet in New York. That seems pretty much in-line with what I expect to see on a default setup.

With a theme that doesn't have such a huge header for a background, and was actually utilizing caching where possible, those load times should match or be lower depending on what else is running (i.e. plugins).

Honestly, if it's working without the added bulk, keep it clean and don't worry about them. Your time would be far better spent optimizing elsewhere (i.e. the stack) as opposed to worrying about the map or mapping aspect.

  • @jtittle bro,
    the purpose of my second site installation was to have a knowledgebase & public forum. i have my knowledgebase & forum on my second site but i got another issue.

    its new user registration.
    first of all, the only place i found for user registration related stud is under
    Network admin
    Setting > Network settings.

    is that the only place where i can allow only regular user access who will be posing in my forum?

    If yes, then we will follow along
    inside that panel, there is "Registration Settings"

    Options are

    1. Registration is disabled.
    2. User accounts may be registered.
    3. Logged in users may register new sites.
    4. Both sites and user accounts can be registered.
    

    i believe option 2 should be selected for regular user registration. please correct me if im wrong.

    now, if the registration is allowed, there's another problem. when i click login from my second site forum.mysite.com, login page is on community.mysite.com/wp-login.php

    but when i register, then registration page is on my main domain www.mysite.com/wp-signup.php

    is that normal?

    • @newbie

      Since WordPress doesn't install a full instance of WordPress for each site you deploy, and each site in the network uses the same core, IIRC, that's normal. That may differ if you're using domain mapping (mapping actual domains to sub-domains / sub-directories), but if your simply registering new accounts on a network site, there's only one signup file for WordPress, thus only one place to go.

      As far as registration in general, if you don't want users to be allowed to create network sites, then yes, option two should be the one you use. Both 3 and 4 will allow others to create network sites, not just accounts.

Have another answer? Share your knowledge.