"Could not reverse map the HTTPS VirtualHost to the original" on Ubuntu

My domain is:
nautha.de

I ran this command:
sudo letsencrypt --apache

It produced this output:
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…

The operating system my web server runs on is (include version):
Ubuntu 16.04.4

I can login to a root shell on my machine (yes or no, or I don’t know):
yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
no

The only guess I have right now ist, that certbot doesn’t like my structure of the virtualhost

Is there a expected structure somewhere?

Mine currently looks like this:
<VirtualHost *:80>
ServerName www.nautha.de
ServerAlias nautha.de
DocumentRoot “/var/www/nautha”
< /VirtualHost> The space here is just so the site does display this line

Hi @Nautha

do you have a https - host?

I don't know, if Certbot creates a https - host if nothing exists. Add a standard - https - entry with the same DocumentRoot on port *:443.

Can I that in the same .config or do I need a seperate one?

Maybe it is important to add, that I am running two domians and one subdomain on the same server with each of them having their own vhost file

Yes, it's not necessary to have an existing HTTPS virtual host. Certbot will create one for you.

Do you have an ambiguity about which virtualhost is applicable to this domain?

Thanks, good to know.

i do’nt andestand :worried:

@jachhunter777, are you having a similar problem? If so, could you start a new thread on this forum and fill out all of the questions that appear?

Found a fix and thought if someone ever has the same problem he or she might find this usefull.

As I tried it again I realiced that the certificat was succesfully created but it just couldn’t update my vhost file.
So I did this manualy. It now looks like this:

<VirtualHost *:80>
ServerName www.nautha.de
ServerAlias nautha.de
Redirect “/” “https://nautha.de/
</ VirtualHost>

<VirtualHost *:443>
ServerName www.nautha.de
ServerAlias nautha.de
DocumentRoot /var/www/nautha
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/nautha.de/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nautha.de/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/nautha.de/chain.pem
</ VirtualHost>

Again the spaces between the “/” and the “VirtualHost” are just there to prevent the Editor of hiding the line.

You just need to replace the paths after SSLEngine On with the paths it gives you when the certificates are created.

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