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
Make a DNS CNAME record for the ELB's hostname. Then use the CNAME's hostname as the DOMAIN_CURRENT_SITE.
Just an update - it turned out the issue was caused by not including the correct IP addresses in the security group for the EC2 instances and the load balancer. Once I added the addresses to each security group the ELB was able to direct traffic to the instances without a problem.
Related
I'm migrating a bitnami wordpress site from AWS lightsail to GCP.
The AWS's setup includes a purchased wildcard SSL. When I set up the loadbalancer in GCP, I opt for Google's SSL instead.
I got this error Error code: SSL_ERROR_NO_CYPHER_OVERLAP when I access from the loadbalancer's IP. The VM is working fine and I am able to access it with it's own external IP.
The domain is still pointing to AWS's server. I wonder if the error is because I have not pointed the domain to the load balancer's IP?
I'm hoping to gain some clarity first before I update the domain's IP. I want to avoid situation where it does not work after I make the switch.
Thanks
I am currently using Amazon Lightsail to provide Wordpress Multisite Hosting for a couple of my clients, but I'm running into an issue.
I am working with the following technologies:
1) Wordpress Multisite (2 installations on the same server)
2) Webmin / Virtualmin for server management
3) Amazon Lightsail for Server provisioning
4) Amazon Lightsail Static IP (Pointed to the lightsail server)
Currently Amazon Lightsail only allows 1 static IP address to be assigned to an instance, however, to avoid DNS conflicts, I want to give a dedicated IP address to each wordpress multisite installation.
Webmin / Virtualmin has the ability to manage multiple IP addresses and allows me to assign a specific IP address to a new virtual server once it's provisioned. (detailed here: https://www.hostwinds.com/guide/add-new-ip-address-virtualmin/)
The issue I'm facing is that if a new website (a wordpress multisite's child-site) is set up, the two installations will get "confused" on where to route the domain if they are both running on the same IP address. The current workaround i've used is to set up the domain as an alias to the multisite installation I want to be used. This is effective, but inefficient.
I'm a newbie when it comes to the in-depth setup of server networking so I am hoping to have some assistance here. answering one of these questions may allow me to achieve this goal:
Is there any way to use an ADDITIONAL static IP address with Amazon lightsail?
Is there a way to register / lease / purchase an IP Address from an EXTERNAL source and make it work with my installation?
Is there a way to use this multiple IPv4 addresses for EC2 Solution on Lightsail?
If nothing else, I would just provision a new server and separate the two multisite installations, but then I need to double-up my server management.
At the present time, there is no way to assign two static IP's to a single lightsail instance.
FWIW: I run multiple wordpress instances on a single lightsail instance with no issues. I'm not using multi-site though.
If you're running multiple wordpress multi-site instances on a single server, you probably want to think about using two lightsail instances.
I'm trying to set up SSL on my wordpress site.
I've an EC2 instance running wordpress on nginx and ubuntu. Database running on RDS.
I've launched an application load balancer with listeners on ports 80 and 443 and attached the SSL certificate which I got via ACM. I've set my targets to point to the EC2 instance I am using.
At this point the how-to guides and information stops. Apparently that's all there is to it and it should now all be working. However it's not. I'm getting connection refused errors when I add the https to my site's URL.
When I put my URL into https://www.sslchecker.com/sslchecker I'm told that no certificates are found.
So clearly I need to something more to get this working - can anyone point me to the next step?
Using the ELB and ACB is the way to go here. It sounds like you might be using the wrong type of ELB though. You mentioned application load balancer, you should use a classic load balancer. Also make sure your security groups are setup correctly to allow your ELB to talk to the EC2 instance.
You didn't mention Route53 but I assume you have the DNS entry setup to point at the ELB as well.
Share more and I will help more. Good luck.
When firing up multiple new EC2 instances, how do I make these new machines automatically accessible publicly on my domain ****.example.com?
So if I fire up two instances that would normally have a public DNS of
ec2-12-34-56.compute-1.amazonaws.com and ec2-12-34-57.compute-1.amazonaws.com
instead be ec2-12-34-56.example.com and ec2-12-34-57.example.com
Is there a way to use a VPC and Route53 or do I need to run my own DNS server?
Lets say you want to do this in the easiest way. You don't need a VPC
First we need to set up an elastic ip address. This is going to be the connection point between the Route53 DNS service (which you should absolutely use) and the instance. Go into the EC2 menu of the management console, click elastic ip and click create. Create it into EC2-Classic (option will pop up). Remember this ip.
Now go into Route53. Create a hosted zone for your domain. Go into this zone and create a record set for staging.example.com (or whatever your prefix is). Leave it as an A record (default) and put the elastic IP in the textbox.
Note you now need to go into your registrar login (e.g. goDaddy) and replace the nameservers with the ones shown on the NS record. They will look like:
ns-1776.awsdns-30.co.uk.
ns-123.awsdns-15.com.
ns-814.awsdns-37.net.
ns-1500.awsdns-59.org
and you will be able to see them once you create a hosted zone.
Once you've done this it will redirect all requests to that IP address. But it isn't associated with anything. Once you have created an instance, go back into the elastic ip menu and associate it with the instance. Now all requests to that domain will go to that instance. To change just re-associate. Make sure your security zones allow all traffic (or at least HTTP) or it will seem like it doesn't work.
This is not good cloud architecture, but it will get the job done. Better cloud architecture would be making the route point to a load balancer, and attaching the instance to the load balancer. This should all be done in a VPC. It may not be worth your time if you are doing development.
I'm running five wordpress sites (#EC2) all having it's own elastic IP tied to a proper domain name. I reached the max limit when wanted to launch another site (another domain).
Besides of the obvious; asking for more EIPs, can I use route 53 and pointing to the dynamic EC2 hostname?
As far as I understand this will destroy/mess-up all internal links of the wordpress instance, the moment I reboot or stop/start the instance, because it gets a new IP/hostname and all image-links of wordpress by default are absolute for SEO reasons.
Has anybody found a solution to this, or is my only option to ask for more EIPs?
In my opinion, requesting more EIP's is going to be the easier way to go.
You can set up your DNS to point the public ip of any instance, if its not an eip, it will change if the instance ever stop/started again. In which case you need to update DNS.
Wordpress doesn't really care what the hostname or ip address is of the instance. It cares what hostname you want it to respond to. Even if the underlying ip changes, as long as the hostname records are updated to the new IP, you wont have any issues.