Skip to main content

Posts

Showing posts from September, 2020

Multiple domain SSL certificates on AWS lightsail...

This one caused some confusion today! I have an AWS lightsail server set up. It handles multiple different domains - essentially the same codebase, but does different things depending on the hostname (domain) being used to access it. I needed to add a new letsencrypt certificate to the system. This would be the second one I've added. After generating the certificate, I found that the new site (called it domain2) was trying to use the certificat of the first site (domain1) ... I thought I'd generated a certificate that supported both domains, but apparently not. After some poking around (lightsail has its own way of setting up the apache configuration files) I finally figured it out. To fix it, I needed to have two different virtual host (port 443) directives. They were essentially alike, except that that I had to add ServerName and ServerAlias settings appropriate for domain1 and domain2, and set the SSLCertificateFile and SSLCertificateKeyFile settings appropriately. Now I j