Open evandiamond opened 7 years ago
@serundeputy is going to start some initial work on supporting this.
WordPress Guides: http://mashable.com/2012/07/26/beginner-guide-wordpress-multisite/#OQdBgaxWJqq3 https://premium.wpmudev.org/blog/ultimate-guide-multisite/
Pantheon docs: https://pantheon.io/wordpress/wordpress-multisite
I spun up a generic WP site using the wordpress
recipe and enabled Multisite per: https://codex.wordpress.org/Create_A_Network
From outside the container (localhost) I get 404s to the subdomains both in browser and curl:
geoff@yep wp-local-mu $ curl -I http://blah.wp-local-mu.lndo.site/
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Fri, 25 Aug 2017 12:37:10 GMT
Content-Length: 19
From inside the appserver container 200:
www-data@519472ba2809:/app$ curl -I http://blah.wp-local-mu.lndo.site/
HTTP/1.1 200 OK
Date: Fri, 25 Aug 2017 12:36:57 GMT
Server: Apache/2.4.10 (Debian)
X-Powered-By: PHP/7.1.7
Link: <http://blah.wp-local-mu.lndo.site/wp-json/>; rel="https://api.w.org/"
Content-Type: text/html; charset=UTF-8
From database container 200:
root@776716edbd8f:/app# curl -I http://blah.wp-local-mu.lndo.site/
HTTP/1.1 200 OK
Date: Fri, 25 Aug 2017 12:46:43 GMT
Server: Apache/2.4.10 (Debian)
X-Powered-By: PHP/7.1.7
Link: <http://blah.wp-local-mu.lndo.site/wp-json/>; rel="https://api.w.org/"
Content-Type: text/html; charset=UTF-8
This made me think adding subdomain routes to the appserver might work a la: https://docs.lndo.io/config/proxy.html, but so far I've not been able to get that to work in a wordpress
recipe.
@serundeputy maybe we can take a look at this together sometime soon. It looks like things might be easier to get rolling than i had previously thought. 🤞
This would be awesome!
On Fri, Aug 25, 2017 at 7:21 PM Mike Pirog notifications@github.com wrote:
@serundeputy https://github.com/serundeputy maybe we can take a look at this together sometime soon. It looks like things might be easier to get rolling than i had previously thought.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kalabox/lando/issues/157#issuecomment-325054701, or mute the thread https://github.com/notifications/unsubscribe-auth/AM7eGlellcioEjNGWwgp2ZHyr7NBXz-xks5sb1cGgaJpZM4OTYJc .
--
Evan
I'm starting to use Lando for managing multisite of Pantheon WordPress. I pulled the db and files and ran into an issue that's on Trac here https://core.trac.wordpress.org/ticket/41424 also been raised in https://github.com/pantheon-systems/documentation/issues/2982.
In my case I was able to use the existing wp search-replace
command plus the following to get multisite loading in Lando environment: lando wp search-replace "domain.com" "domain.lndo.site" wp_blogs --url=domain.com
I was able to get basic multi-site working with the stock WordPress recipe fairly easily. I think existing sites and more complex domain setups may take more work, but here's the steps I took.
lando init --recipe=wordpress
Add some extra domains to the proxy section
proxy:
appserver:
- siteone.lndo.site
- two.siteone.lndo.site
- three.siteone.lndo.site
Add settings to wp-config.php
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'siteone.lndo.site');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
Update the .htaccess
file per WordPress network install instructions:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
Then I had to run lando rebuild -y
for it to pick up the .htaccess
changes it seemed.
I believe the only part that is likely to get sticky for others is the multi-domain stuff. Nginx support would take more work since a custom config would be needed instead of .htaccess
overrides. Doing the search-replace sort of work and stuff from existing sites is a real pain, but not really something that has to do with Lando, more of a WP thing.
Happy to do more tests and offer more advice, but I think documentation is probably all that's needed here, unless we want to work on custom nginx configs or a more automated setup of some sort.
Doing the search-replace sort of work and stuff from existing sites is a real pain, but not really something that has to do with Lando, more of a WP thing.
I think it should be possible to do this more automatically with fewer (or no) DB changes, by overriding the WP logic to pick a site based on the incoming URL.
Edit: This ended up being more trouble than it was worth. Do not recommend.
I gave it a shot here: https://github.com/ClassicPress/ClassicPress-Network/pull/5
It is pretty specific to our setup (every site is a subdomain, with www.
as primary), but it seems to work. Something a bit more general could be interesting too.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.
Is there a document for WordPress on how to setup lando and WP for multisite? I'm trying to configure a sub-folder install and struggling.
@pirog ^^
@digisavvy not that im aware of. this is something we plan to first-class support in Lando 4 but that is still months out.
that said, it's highly likely someone in the lando Slack has got a recipe or guide etc. If they do it would be slick to add it as a guide in our wordpress docs: https://github.com/lando/wordpress/tree/main/docs
Why is this issue closed if Lando 4 is meant to be helping with it and not out yet?
@robclancy not sure but reopening and moving to https://github.com/lando/wordpress
Bug Report
Tell us about your setup WordPress Multi-site from Pantheon
What is your lando version and operating system? lando-v3.0.0-alpha.13 on Running Mac OS Sierra 10.12.5
Have you previously installed lando? If so, what version? No
Tell us about your bug I don't think Lando plays well with WordPress Multi-site.
Please detail the steps we can take to replicate this bug. Be as detailed as possible.
If I can just get this last part working I'll be golden, everything else is working great! @pirog
Feature/Enhancement Request
Would love to see WordPress multi-site support!