Deat WMPU Community...
I have a question I’ve been stuck on for days…maybe you clever peeps at WPMU can help me solve it once... cuaseI'm just chasing my tail right now.
The basic question is: can you run at active blog off the network (primary domain)? Or is the ‘network’ effectively represented by the blog1.sub-domain?
Before I tried anything with the WordPress multisite (fresh install). I:
1. Routed the apache httpd.conf to include a v-hosts.conf file with entries for my primary domain (example.com) and sub-domain (blog1.example.com).
2. Edited the hosts file to make sure all that both the primary and sub-domains (and their aliases ) pointed to localhost 127.0.0.1. (This took DNS out of the equation).
3. I got temporary certified SSL certs for both the primary domain (example.com) and the sub-domain (blog1.example.com).
4. Did a global database and file replace of http: with https: and installed various SSL supporting plugins such as ‘WordPress HTTPS’, ‘SSL Insecure Content Fixer’ and later ‘WP Force SSL’.
So my set up is:
I’ve got apache virtual hosts set up for example.com and blog1.example.com.
My wp_site.domain is set to example.com and my wp_sitemeta,siteurl is https://example.com/
My wp_options.home and wp_options.siteurl are set to https://example.com.
This then is effectively the ‘network’ where the vhost example.com should map to the network as set up in wp_site and wp_sitemeta.
Then in the wp_blogs table I have: blog_id = 1, site_id = 1 domain = blog1.example.com.
wp_1_options.home and wp_1_options.siteurl are set to https://blog1.example.com.
My wp-config.php is simply:
define( 'WP_MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', ‘example.com’ );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
This set-up assumes that the primary domain example.com cannot be used for a user-facing blog but is only really of use to an administrator who wants to effect global site-wide configs. (This doesn’t quite make sense to me as I thought one of the ways you can use multisite is to hosts microsite subdomains within a single-sign-on primary domain) That's why wp_users , wp_usersmeta are not recreated for each sub-blog instance?)
Now IF this is the way WordPress MU/network works that's fine except a couple of niggles:
1) All the non-blog_id incremented wp_ tables like wp_comments, wp_terms etc are redundant. In fact, I don’t really see the point of wp_options because it's wp_sitemeta that defines network wide config like ‘active_sitewide_plugins’ and ‘allowable_themes.’
2) It means that my primary domain name will always have to be diverted to a sub-domain from a user URL perspective.
But the fact is that this logical set-up DOES NOT work. There are a lot of problems with this set-up. For example I would expect surfing to:
https://.site1.example.com should take me to the front page of an active blog. In fact, bizarrely it diverts me to https://example.com/wp-signup.php?new=example.com and hangs with ‘redirected you too many times.’
Ditto if I go direct to: https://example.com/wp-admin I reckon should be directed to the network superadmin login dashboard. It hangs with ‘redirected you too many times.’
https://site1.the-guest-house.com/wp-admin actually takes me to what I initially thought was the network admin dashboard, because it displayed a Sites drop-down with Network Admin & Site1 in the Sites Selector. However if I try to switch to the Network Admin it fails and in every other way it feels like I’m a sub-domain/blog1 administrator: I don’t have the Network Name in the Top Bar, I have a full set off plugins config on the side menu whereas the network admin is generally much reduced to display only ‘Network Only plugin options on the dashboard side menu. Edit Themes wasn’t about selecting site/network wide available themes but selecting A single theme for blog1.
ALT CONFIG 1
So I thought I would change the wp_blog.domain back to example.com and when I surf to example.com I get a front-page with the blog1 theme but a 404 error?
Surfing to example.com/wp-admin or blog1.example.com/wp-admin diverts me to https://example.com/wp-signup.php and:
I get the error: “The site you were looking for, http://blog1.example.com/, does not exist”,
It displays the theme of the blog (although this could be an identical theme to the network site for which it was cloned).
I get the message “Get your own [Network Name] account in seconds” "User Name: blog1 Email Address: blank." If I fill out the email address with a [new email address] than my previous network login email and hit ‘Next’ I get a message “blog1 is your new username". "But, before you can start using your new username, you must activate it. Check your inbox at [new email address] and click the link given”. Now I never received the email cause my warders SMTP/PHP mail server isn’t set up.
ALT CONFIG 2
So I thought I would also point wp_1_options.siteurl & wp_1_options.home to example.com as well. But if I change this to align with wp_blog.domain (i.e. https://example.com) I get the ‘too many redirects’ error. However, example.com/wp-admin logs me into what looks again like blog1. Of course, in this instance, the URL for the ''network' is identical to 'blog1'? And indeed so are is the 'network' user name/password and 'site1' user name/password. So how would WordPress know whether I'm logging in as the Network Admin or the Blog1 Admin?
My diagnosis to date:
I have at the very least been able to login as Network Admin previously. So there is something I’ve done to either the database config or plugin enablement that has screwed things up.
Part of my confusion derives from the fact that there is a really confusing muddle between what WordPress sometimes calls blogs and other times calls sites or networks . I know really site=networks and blogs=sub ‘sites’ (sub-domains).
Another part of this maybe due to the fact the Bitnami sourced Wordpress Multisite (MAMP based) Stack helpfully included a wp-config.php which had both define(WP_ALLOW_MULITSITE, True) AND define( 'WP_MULTISITE', true ). This effectively meant I bypassed the initial step of setting up the network and specifically specifying whether it should be sub-domain or sub-directory based. I think I got away with it cause it seems to have defaulted to sub-domains. But I did have to manually create the wp_1 tables. This indicates to me that the network is represented by blog1. In fact, there is no way of specifying a single ’theme’ for the just the network ‘blog’, because themes selected at the nrtwork level are just enabling sub-blogs to load these themes.
This Bitnami install also didn’t include the recommended .htaccess multisite config, either directly in the file or the allegedly OVER-RIDING config files httpd-app.conf and htaccess.conf. Both just had standard single-site .htaccess configs and some code which seemed to allow the Akismet plugin to write to .htaccess. If these conf files do over-ride .htaccess (I have read that .htaccess should really be blank) this indicate to me that these conf files don’t overwrite .htaccess file (they don’t) but simply replace or append the content of .htaccess when loaded into memory,
Part of it maybe that I’m really TIRED and getting confused between:
Apache Virtual Hosts
wp_site.domain & wp_sitemeta,siteurl (well these shouldn’t matter: I’ve only got one network),
wp_options.siteurl & wp_options.home (Don’t think this matters at all?).
wp_1_options.siteurl & wp_1_options.home. (Don’t know what function this serves?)
Ever since setting up this multisite and I have constant dashboard errors from security plugins saying that they can’t write to .htaccess. Other issues include:
1. All Media Library uploads from blog1 fail.
2. If I try and set up a blog1 user the ‘role’ dropdown is not populated! Even though the role lookup data is in the database.
3. I haven’t been able to debug 2 because despite switching on ‘save queries’ in wp-config.php there have been no writes of ANY kind to wp-contents.debug.log for 7 days now?
4. I have read that if you select theme for a multi-site blog it should
Each time I change a config or database entry I restart apache and clear out the chance and cookies from my browser.
Could be nothing todo with these database setting. Could be file permission’s, the dark art of apache mod-rewrite, allow overrides type config. or plugins conflicts. I have tried disabling a number of suspect plugins but I note the just renaming the each target plugin sub-directory to DISABLED_ does not in itself stop Wordpress multisite from picking them up. You have to move them out to a neighboring directory… this is different from previous single site Wordpress installs I have used.
I’ve even checked at my user permissions ‘ where wp_sitemeta.metakey = 'site_admins’. The meta_value s:X number needs to equal the count of letters in your username to be granted Super Admin Rights. (This is the kind of nonsense obscure algorithm that’ll knock Wordpress out of the game by the like sof Wix, Weebly and Squar space with in the next decade IMHO).
I am using Apache 2.4+, PHP 6.x+, SQL 5.6+, Wordpress 4.5.2. on Mac OS X 10.10.5 (Yosemite). Unfortunately, this is a local environment and not accessible through the net,
My ultimate aim is to load up an already partly developed single site WordPress instance into a ‘default primary blog’ that maps to my primary domain. Then use multisite to enable sub-content areas and theme switching and possibly different administrators, forum moderators, editors for different sub theme microsites. But:
A) I don’t know whether to load this ‘master blog framework’ into wp_ tables or wp_1.
B) And besides, until I’ve resolved some of these other issues it would seem foolhardy.
But I reckon the answer to this riddle is staring me in the face and one of you with a fresh mind will take a quick look and point out the obvious. For that I would be truly grateful.
Many thanks to anyone with the patience the read this!