Could not reverse map the HTTPS VirtualHost to the original

August 1, 2018 1.7k views
Let's Encrypt Ubuntu 16.04

Hi,

I’m trying to set up multiple domains on a single droplet. I have followed the various articles available on DO on setting up multiple vhosts and how to install a lets encrypt certificate. The certificate for the first domain installed fine, but when I try and install a certificate for the second domain, I get the following message;

Could not reverse map the HTTPS VirtualHost to the original

IMPORTANT NOTES:

  • Unable to install the certificate
  • Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/mydomain.net/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/mydomain.net/privkey.pem Your cert will expire on 2018-10-28. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the “certonly” option. To non-interactively renew all of your certificates, run “certbot renew”
  • Some rewrite rules copied from /etc/apache2/sites-enabled/mydomain.net.conf were disabled in the vhost for your HTTPS site located at /etc/apache2/sites-available/mydomain.net-le-ssl.conf because they have the potential to create redirection loops.

I cannot find much information on the web and am looking for someone to point out where I’ve gone wrong.

Thanks,

Chris

4 Answers

Did you have any rewrite rules on your second domain before you created the ssl key?
Maybe some redirect rules that specifically referred to http:// ?

Sounds like letsencrypt commented out some redirect rules on your https site, I think those would be the first one to look at.

  • thank you! I had “htaccess” redirection, so remove that and it completed now, and returned that file back then.

I haven’t uploaded anything to the second site yet except an index.html file to allow me to see when it’s working.

The perfect template. Try this. Worked for me after days of looking for solution.

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /var/www/html

<Directory /var/www/html/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Have another answer? Share your knowledge.