{"id":4213,"date":"2020-10-08T20:02:57","date_gmt":"2020-10-08T20:02:57","guid":{"rendered":"https:\/\/puvox.software\/blog\/?p=4213"},"modified":"2021-11-14T13:45:47","modified_gmt":"2021-11-14T13:45:47","slug":"solution-could-not-reverse-map-the-https-virtualhost-to-the-original","status":"publish","type":"post","link":"https:\/\/puvox.software\/blog\/solution-could-not-reverse-map-the-https-virtualhost-to-the-original\/","title":{"rendered":"[Solution] Could not reverse map the HTTPS VirtualHost to the original"},"content":{"rendered":"<div class=\"default-content-clss content_4213 type_post \">\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2020\/10\/ssl-install-vps.png\" alt=\"\" class=\"wp-image-4214\" width=\"524\" height=\"197\" srcset=\"https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2020\/10\/ssl-install-vps.png 524w, https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2020\/10\/ssl-install-vps-300x113.png 300w, https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2020\/10\/ssl-install-vps-400x150.png 400w\" sizes=\"(max-width: 524px) 100vw, 524px\" \/><\/figure>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\"><strong>Install SSL (Let&#8217;sEncrypt) certificate on VPS<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In some cases, when you try to install Let&#8217;sEncrypt SSL certificate on website in order to turn on the HTTPS:\/\/ , you might use the certbot package to do that. However, in some cases people get the error during setup:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Could not reverse map the HTTPS VirtualHost to the original\n...  \nUnable to install the certificate<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The problem (as it says) means that the server doesn&#8217;t have any HTTPS virtualhost config directives for the target domain-name. So, these steps might help (note, change all occurences of <code>example.com<\/code> with your domain):<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Create <code>my-site.conf<\/code> in <code>\/etc\/apache\/sites-available\/<\/code> with <a href=\"https:\/\/pastebin.com\/sJpHKGAG\">this content<\/a><\/li><li>Create <code>my-site-ssl.conf<\/code> too, with <a href=\"https:\/\/pastebin.com\/GefnBZ4S\">this content<\/a><\/li><li>In terminal\/ssh, type: <br><code>a2ensite my-site.conf<\/code> <\/li><li>Type:<br><code>systemctl restart apache2<\/code><\/li><li>try to install certbot again with same command you did. <\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">That might work for some people. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><em>if these steps will not work, you might also try at step<code> 3 <\/code>: <code>a2ensite my-site-ssl.conf<\/code><br>and at step 5,  in <code>my-site-ssl.conf<\/code> uncomment the hinted lines and restart apache again.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<div class=\"default-content-clss excerpt_4213 type_post \"><p>Install SSL (Let&#8217;sEncrypt) certificate on VPS In some cases, when you try to install Let&#8217;sEncrypt SSL certificate on website in order to turn on the HTTPS:\/\/ , you might use<a class=\"excerpt-read-more\" href=\"https:\/\/puvox.software\/blog\/solution-could-not-reverse-map-the-https-virtualhost-to-the-original\/\">(Continue Reading)<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":4214,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[13],"tags":[],"class_list":["post-4213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website"],"_links":{"self":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/4213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/comments?post=4213"}],"version-history":[{"count":0,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/4213\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media\/4214"}],"wp:attachment":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media?parent=4213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/categories?post=4213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/tags?post=4213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}