Multiple Servers One Domain Wordpress


#1

I have asked this particular question multiple times and get varied answers from VPS providers, Control panel Vendors etc., I would love to get the definitive answer from the LetsEncrypt community.

I have multiple servers serving the same Wordpress websites in different worldwide geographic regions. The websites are served to the clients from the nearest server dependent on their geographic location. It works very well and loading speeds are very fast as a result. Is it possible to have LetsEncrypt certificates installed on each server for each domain without creating conflicts?

Any guidance appreciated.


#2

What kind of conflicts are you referring to?

One of the issues you need to tackle is the authorization challenge, as it’s not know which server will serve the request coming from Let’s Encrypt if you want to use the http-01 or tls-sni-01 challenge. Therefore, only the DNS challenge will be useful in this use case I recon.

Do you want a certificate for every server? Or distribute one single cert among the servers?


#3

Thanks for your reply.

I believe the conflict exists as different certs on different servers will fail as each cert was created independently and so as each cert is challenged it will invariably fail. I honestly don’t know which is the best way to go. I don’t necessarily need a different cert on each server and one cert for all servers would be great.

I don’t mind creating multiple certs or distributing one cert among all servers. The most efficient solution for me is to get it working and avoid any potential mishaps by doing the wrong thing at the beginning.

My alternative if I wasn’t to use LetsEncrypt would be to purchase certs for each domain at $60 each, I would prefer not to go down that route just yet.


#4

You only had one domain I thought?


#5

I have at least 10 domains per server and intend on adding another 40. Each domain has its own website duplicated on each server.


#6

Ah, because your title of the threads mentions “(…) One Domain (…)”, so I was confused…


#7

Based on your post, if you have a way to securely distribute the private key and the certificate, using DNS auth and distributing the certificate across the servers would probably be the best option for your needs. This, of course, assumes you can automate the challenge in some way.


#8

Thats the thing, I don’t have a method to do this or the knowledge yet to set up the best way to automate the process. I’m all ears and am open to suggestions of how to accomplish this and eager to learn if anyone else has successfully done this.


#9

It depends on how your DNS is set up. Many providers offer an API for changes to be done. You can check with your provider to see if such a feature is available. You’ll need to just set a TXT record to a specified value provided by the Let’s Encrypt servers.


#10

That shouldn’t be a problem as I use an external DNS like Constellix or EdgeDirector. Can anyone give an example of what the setup procedure would be regards the DNS Zone/Records.


#11

The “LE client” that you use (the officlal client is certbot, or there are various alterntives ) will communicate with Let’s Encrypt and obtain a token which is to be added to your DNS records. It will provide this token to you (either printed to the screen, or more commonly as a variable you can use in a script).

You need to add this token as a TXT record in _acme-challenge.yourdomain.com

Adding the token can easily be done using a script if you have a good API to your DNS records.

You then ask Let’s Encrypt to verify the token is there ( the “LE client” will do that) and if it’s correct it will provide you with a certificate.


#12

So one cert issued form LetsEncrypt and one TXT record in the DNS Zone for that domain would be sufficient to cover that domain on all servers?
As it would be irrelevant which location the website is accessed from because the TXT record for that domain will always be available to verify with LetsEncrypt? Is this correct?


#13

Correct. That’s the way I do it ( although not wordpress, but that’s irrelevant ). I obtain one cert (via script) and that same script copies it to all the servers it needs to go on, and reloads the services there. All done in a matter of seconds, automatically.


#14

Genius!! After a year of trying I finally got my answer. !! What script would you recommend or can you point me to a resource?


#15

I’m biased, as I wrote my own - GetSSL which is a simple bash script because at the time certbot didn’t have the capability (early 2016).

Certbot now does support the DNS challenge and has a scripting option, so should be able to do it perfectly and automate the process.


#16

Thank You. Really well documented as well.


#17

You’re Welcome :slight_smile: Thanks :slight_smile: - there is also an example of the DNS challenge in the wiki - https://github.com/srvrco/getssl/wiki/DNS-Challenge-example


#18

Not to bypass @serverco here, as he deserves much credit for his client, but you might also be interested in acme.sh, another bash client in the list of clients, of which I know it has many, MANY (currently 14) DNS API integrations built-in.


#19

Thanks for that. Also really good and very well documented.


#20

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.