Question

How to use SSL with domain mapping in multisite wordpress

Posted September 23, 2020 1.2k views
WordPress

So, I have a multisite wordpress with two domains, I installed a SSL certificate on the second domain, but doesn’t seem to work, how can I make this work?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Hi @kvny,

You’ll need to update your WebService’s config file (Apache/Nginx) to include the SSL you’ve installed. Can you let us know which of the two mentioned you are using so that I can provide you with more information on how to reach/find where to update the config files?

If you are unsure how to check which one you are using, you can enter your droplet via SSH and type in the following command:

netstat -tulpen | grep 80

It should display what service is listening on port 80, either Apache or Nginx. From there you can enter your configuration file and add your SSL bit to it.

Regards,
KFSys

It’s relatively easy to get certbot going to create and install the certificate, but the problem is that you can’t create multiple sites configs in Apache and then let certbot create a certificate for them all, since the forwarding that will be set up, conflicts with the forwarding done in Wordpress by the domain mapping plugin. So here’s how I got going.

For the single site config in Apache (the main network site in Wordpress), create a certificate, but specify all the domains to be added to the certificate by using the -domain option and add each domain in the wordpress network of sites.

certbot --apache --domains new.domain.com --domains second.com --domains yetanotherone.net

Now the certificate will validate all the domains in the network site.

If you add more domains, just rerun the certbot command