{"id":612,"date":"2017-02-11T12:17:29","date_gmt":"2017-02-11T15:47:29","guid":{"rendered":"https:\/\/blog.pelleys.com\/?p=612"},"modified":"2017-02-11T12:18:44","modified_gmt":"2017-02-11T15:48:44","slug":"lets-encrypt-doing-dumb-things","status":"publish","type":"post","link":"https:\/\/blog.pelleys.com\/?p=612","title":{"rendered":"Let&#8217;s Encrypt &#8211; Doing Dumb Things&#8230;"},"content":{"rendered":"<p>Problem:<\/p>\n<p>I moved servers &#8211; copying the Apache configuration and \/etc\/letsencrypt to the new server. Everything went well but now when I have to renew I cannot. I get all types of errors.\u00a0(Yes, I <strong>KNOW<\/strong> that I did a really dumb thing forgetting to copy my backups as well <img decoding=\"async\" class=\"emoji\" title=\":cry:\" src=\"https:\/\/cdn-enterprise.discourse.org\/letsencrypt\/images\/emoji\/emoji_one\/cry.png?v=3\" alt=\":cry:\" \/>)<\/p>\n<p>Solution:<\/p>\n<p>Here is what I had to do &#8211; much of it is similar to getting the &#8220;starter&#8221; Apache 2 SSL set up<\/p>\n<ul>\n<li>You need to create the self-signed certificates first (e.g. &#8220;sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/apache-selfsigned.key -out \/etc\/ssl\/certs\/apache-selfsigned.crt&#8221;)<\/li>\n<li>Once that is done, you need to create the SSL vhost files (assuming you are using virtual hosts &#8211; I am) using the self-signed certificates. You can (I did, at least) use the same self-signed certificate for each vhost. The important thing to note here is that letsencrypt must have apache running ssl already. It will not work if apache is not up and\/or there are no ssl sites. (This drove me mad for a couple of hours!)<\/li>\n<li>Once this is done you can back up your \/etc\/letsencrypt directory (you could probably blow it away but you are probably paranoid now <img decoding=\"async\" class=\"emoji\" title=\":slight_smile:\" src=\"https:\/\/cdn-enterprise.discourse.org\/letsencrypt\/images\/emoji\/emoji_one\/slight_smile.png?v=3\" alt=\":slight_smile:\" \/> )<\/li>\n<li>Restart apache (e.g., apache2ctl restart &#8211; by this time I will terminate with extreme prejustice <img decoding=\"async\" class=\"emoji\" title=\":imp:\" src=\"https:\/\/cdn-enterprise.discourse.org\/letsencrypt\/images\/emoji\/emoji_one\/imp.png?v=3\" alt=\":imp:\" \/> )<\/li>\n<li>Check to see if your sites are up and running. Your web browser probably will give you an insecure warning. That is okay &#8211; we will be putting real certificates in place; you just need to ensure that apache is working with ssl.<\/li>\n<li>Run letsencrypt &#8211;apache ya-da, ya-da, ya-da<\/li>\n<li>You might have to restart apache manually after it finishes but that&#8217;s okay<\/li>\n<\/ul>\n<p>Now, don&#8217;t forget to:<br \/>\n1. Back up you letsencrypt directory (I am really paranoid now <img decoding=\"async\" class=\"emoji\" title=\":confounded:\" src=\"https:\/\/cdn-enterprise.discourse.org\/letsencrypt\/images\/emoji\/emoji_one\/confounded.png?v=3\" alt=\":confounded:\" \/>)<br \/>\n2. Back up your apache config files (Yes, I am really paranoid now)<\/p>\n<p>One more thing:<\/p>\n<ul>\n<li>Make sure that the renewals are working (e.g., letsencrypt renew)<\/li>\n<li>Put that in your cron jobs so that it renews each month<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: I moved servers &#8211; copying the Apache configuration and \/etc\/letsencrypt to the new server. Everything went well but now when I have to renew I cannot. I get all types of errors.\u00a0(Yes, I KNOW that I did a really &hellip; <a href=\"https:\/\/blog.pelleys.com\/?p=612\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-612","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.pelleys.com\/index.php?rest_route=\/wp\/v2\/posts\/612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pelleys.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pelleys.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pelleys.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pelleys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=612"}],"version-history":[{"count":0,"href":"https:\/\/blog.pelleys.com\/index.php?rest_route=\/wp\/v2\/posts\/612\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pelleys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pelleys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pelleys.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}