aws-samples / aws-refarch-wordpress

This reference architecture provides best practices and a set of YAML CloudFormation templates for deploying WordPress on AWS.
MIT No Attribution
1.08k stars 601 forks source link

Multisite problems #23

Open dbeja opened 6 years ago

dbeja commented 6 years ago

I launched the stack and everything was working fine, but then I activated multisite option and follow the Wordpress network setup I can't open the site anymore. When I try to login wp-login.php is fine and 200 but it also tries to load load-styles.php directly from one of the private ips that is not even up anymore. It was the ip I used to ssh from bastion to change wp-config. Any ideas what could be the problem?

I also checked issue #14 and added more ports to alb health check but didn't fix the problem.

Thanks

AshMartian commented 6 years ago

I know this is old, but I was able to get Multisite working by updating the _blogs and all _options mysql tables to reflect the DNS of the ELB. This is somewhat problematic when trying to reverse proxy, but I'll post the nginx configuration when I have it working. Should be possible with cloudfront as well, as long as w3-total-cache is configured to minify and serve all js/css files from s3/cloudfront.

kamrankhanwastaken commented 6 years ago

@blandman does your configuration work with top-level domains? I want to use this CloudFormation stack to host a multisite WP that supports multiple domains and the documentation isn't very clear on whether this will work with the existing set of templates.

AshMartian commented 6 years ago

It should work on top level domains, did not configure it for subdomains but should be manually configurable.

On Apr 24, 2018, at 12:16 PM, fakekamrankhan notifications@github.com wrote:

@blandman does your configuration work with top-level domains? I want to use this CloudFormation stack to host a multisite WP that supports multiple domains and the documentation isn't very clear on whether this will work with the existing set of templates.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

kamrankhanwastaken commented 6 years ago

Are you going to commit those changes to the repository or are they already in there?

I was consulting this guide in the WP codex that indicates top-level domains are now inherently a part of WP since 4.5 and shows some basic setup for getting SSLs configured with SNI but I have yet to test. Would love to know if you have done this already.

AshMartian commented 6 years ago

In my test environments ssl is working great with memcached and multisite. I can push what I have tomorrow morning since it is working pretty reliably (5 cloud formation tests with success)

On Apr 24, 2018, at 1:37 PM, fakekamrankhan notifications@github.com wrote:

Are you going to commit those changes to the repository or are they already in there?

I was consulting this guide in the WP codex that indicates top-level domains are now inherently a part of WP since 4.9 and shows some basic setup for getting SSLs configured with SNI but I have yet to test. Would love to know if you have done this already.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

kamrankhanwastaken commented 6 years ago

That sounds great! Look forward to your changes.

AshMartian commented 6 years ago

I've made the push here: https://github.com/psd401/aws-refarch-wordpress Pull that repo and upload to S3 for your template, works with restoring from previous EFS and Database, though with Multisite still manual addition of Multisite wp-config options is still required.

The template I use is templates/aws-refarch-wordpress-master-existing-vpc.yaml

ecout commented 5 years ago

You probably have to modify the template and redeploy the stack from scratch as indeed once you get into multisite the domain becomes a blocker in the database and the site will redirect you, even if you get it working. You want to CREATE the database with multisite from scratch with the respective wp-config settings, otherwise you have to do what @blandman said here: I know this is old, but I was able to get Multisite working by updating the _blogs and all _options mysql tables to reflect the DNS of the ELB. Once you do that if you do a gray box test: Isolate a single instance and hit its ip on multisite mode WITHOUT specifying the HTTP header that tells wordpress where you're coming from(your site FQDN). The wp instance will redirect you to the ELB/ALB thru the Route53 record that is hardcoded on the Multisite database and this makes things tightly coupled. Old CMS environment like wordpress are not designed to be throw away and replace like we do in the Cloud era and thus are tightly coupled so you're bound to run into this kind of trouble.

That's why you use blue/green deployments.