• rleonen

    (@rleonen)


    Hi,

    I’ve set up a multisite WordPress installation and would like to move it to 2 EC2 instances behind a load balancer. My issue is with the wp-config.php configuration setting for the DOMAIN_CURRENT_SITE parameter. I currently have it set as follows

    define(‘DOMAIN_CURRENT_SITE’, ‘ec2-instance-1.us-west-2.compute.amazonaws.com’);

    How should this be set if I am load balancing between multiple EC2 instances? Because it’s multisite the DOMAIN_CURRENT_SITE value is saved in the WP database. I am unsure how this should be set since I am sharing a single RDS db between multiple WordPress instances. If I set it to one of the EC2 host names then the others would generate an error when connecting to the db. I’ve tried setting it to the load balancer domain name (and have updated the domain name in the db) but I’m getting a blank white page and the load balancer shows the EC2 instances as ‘Out of Service’. I’d appreciate any help anyone can offer.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • I guess DOMAIN_CURRENT_SITE should be set to the domain name of the main site in both ec2 instances and also you would have to make sure this information is correct in all the relevant settings of the main site in the database.

    DOMAIN_CURRENT_SITE should be set as your domain name in the wp-config.php file, however… you will need to set up your domain to use NS from AWS by setting up a hosted zone in Route 53 with an IPV4 (A record) set as an alias to point to your load balancers – not the EC2 instance.

    And as a suggestion… There is a whitepaper from AWS that covers a good way to set this up using Elastic Beanstalk so you have the load balancing function across autoscaled EC2 instances as well as utilization of ElastiCache (for Memcache with multiple nodes) and Cloudfront as the CDN accessing an S3 bucket for static content storage.

    NOTE: The paper is based on a single WP install, but as long as you make the changes to the wp-config.php and .htaccess files are done BEFORE you activate and set up W3 Total Cache, the directions are pretty good.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP Multisite behind a load balancer’ is closed to new replies.