Could not reverse map the HTTPS VirtualHost to the original

Hi!

I tried to install Certbot in my Apache with multiple VHost in my httpd.conf, and I got this message:
“Could not reverse map the HTTPS VirtualHost to the original”.

After reading Certbot on Apache - Unable to Parse Multiple VHOSTS in one File, I decided to keep only one VHost in my Apache server.

After reloading Apache, I ran “sudo certbot --apache”, but it returns “Could not reverse map the HTTPS VirtualHost to the original” again. Do I have to clean Certbot previous instalation and start it all over again?

My domain is:
ui.mocknickapps.com.br

I ran this command:
sudo certbot --apache

It produced this output:
Could not reverse map the HTTPS VirtualHost to the original
IMPORTANT NOTES:

  • Unable to install the certificate

My web server is (include version):
Apache/2.4.6 (CentOS)

The operating system my web server runs on is (include version):
CentOS Linux release 7.2.1511 (Core)

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

Thanks in advance!
Regards,

Simone Stadnick

@bmw, could you please take a look at this?

Hi!
I’d be happy to help debug this. Would you be able to share your apache vhost with me? I think that would help me a lot in debugging

Hi @SwartCr!

This is my Apache VHost:

<VirtualHost *:80>
ServerName mocknickapps.com
DocumentRoot "/var/www/html/ui"
ServerAdmin support@mocknickapps.com
ServerAlias ui.mocknickapps.com

Thanks in advance!

Simone

Hi @SwartzCr!

I also tried to install certbot with this Vhost:

<VirtualHost *:80>
ServerName ui.mocknickapps.com
DocumentRoot "/var/www/html/ui"
ServerAdmin support@mocknickapps.com

…just because the only domain name I want a certificate for is ui.mocknickapps.com.

But once again, I got “Could not reverse map the HTTPS VirtualHost to the original” return.

Regards,

Simone

can you share the entire vhost block, including the listen directive and any directives that point at certs?

Hi!

I sent you the entire VHost block in httpd.conf :slight_smile: I have only one VHost.

My listen directive is “Listen 80” (in httpd.conf)

If you want to, I can send you my httpd.conf by email. The same applies to conf.d/ssl.conf.

Thanks!

Simone

that’d help a lot - feel free to private message it to me on the forum

Hello there, I’m having the same issue and since there is no reply marked as answer I’m asking the same thing here.

My domain is:
vendas.ciagroalimentos.com.br

I ran this command:
./certbot-auto --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
    /etc/letsencrypt/live/vendas.ciagroalimentos.com.br/fullchain.pem.
    Your cert will expire on 2017-10-03. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot-auto
    again with the “certonly” option. To non-interactively renew all
    of your certificates, run “certbot-auto renew”

My web server is (include version):
Apache 2.2.15-59.el6.centos.i686

The operating system my web server runs on is (include version):
CentOS release 6.9 (Final)

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

This is the only virtualhost on httpd.conf

VirtualHost *:80
ServerAdmin sac@ciagroalimentos.com.br
DocumentRoot /var/www/html/
ServerName vendas.ciagroalimentos.com.br
/VirtualHost

Since the certificate seems to be ok, if I add the SSL lines to my virtualhost will it work properly?

Hello @JulianoT! This is the asnwer that worked for me:

@SwartzCr:
Yes! I think I have an idea
Your vhost is currently living in httpd.conf in /etc/httpd/conf right?
I think if you move the vhost to be in a conf file in the /etc/httpd/conf.d folder that will fix it. This is because we set /etc/httpd/conf.d as the default folder to check for vhosts on centos. So when we make a ssl vhost to do the challenge with, we end up creating it in the same directory as the vhost that it’s copying (httpd.conf) and then not being able to find it because it’s in /etc/httpd/conf not /etc/httpd/conf.d
Let me know if that works!

1 Like

Yes @mocknickapps it worked gracefully. I think this information should be added to the main page on certbot index, under CentOS installation.

Thank you ver much.

I agree 100%, @JulianoT!

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