{"id":6970,"date":"2022-10-27T14:39:18","date_gmt":"2022-10-27T14:39:18","guid":{"rendered":"https:\/\/www.geekdecoder.com\/?p=6970"},"modified":"2022-10-27T14:39:18","modified_gmt":"2022-10-27T14:39:18","slug":"set-up-lets-encrypt-on-debian-11-with-apache-server","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2022\/10\/27\/set-up-lets-encrypt-on-debian-11-with-apache-server\/","title":{"rendered":"Set up Let&#8217;s Encrypt on Debian 11 with Apache Server"},"content":{"rendered":"<p>Today, we are installing certbot on Debian 11 with Apache2 (Apache\/2.4.54 (Debian). This article assumes you have Apache installed. If not, see <a href=\"https:\/\/www.geekdecoder.com\/how-to-install-lamp-linux-apache-mysql-maria-php-on-debian-11\/\" rel=\"noopener\" target=\"_blank\">How To Install LAMP (Linux, Apache, MySql-Maria, PHP) On Debian 11<\/a>. <\/p>\n<p><!--more--><\/p>\n<p>Here are some great sources: https:\/\/certbot.eff.org\/instructions<\/p>\n<p>The recommended way is to use snappy.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo apt update\n<\/pre>\n<p>Then install the snapd package:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo apt install snapd\n<\/pre>\n<p><a href=\"https:\/\/linuxandotherstuff.net\/wp-content\/uploads\/2022\/10\/2022-10-27_09-47-03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-6975\" src=\"https:\/\/linuxandotherstuff.net\/wp-content\/uploads\/2022\/10\/2022-10-27_09-47-03-1024x496.png\" alt=\"\" width=\"640\" height=\"310\" srcset=\"https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-27_09-47-03-1024x496.png 1024w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-27_09-47-03-300x145.png 300w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-27_09-47-03-768x372.png 768w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-27_09-47-03.png 1284w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo snap install core\n<\/pre>\n<p><a href=\"https:\/\/linuxandotherstuff.net\/wp-content\/uploads\/2022\/10\/2022-10-27_09-48-32.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6976\" src=\"https:\/\/linuxandotherstuff.net\/wp-content\/uploads\/2022\/10\/2022-10-27_09-48-32.png\" alt=\"\" width=\"508\" height=\"53\" srcset=\"https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-27_09-48-32.png 508w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-27_09-48-32-300x31.png 300w\" sizes=\"auto, (max-width: 508px) 100vw, 508px\" \/><\/a><br \/>\nThen refresh the core snap.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo snap refresh core\n<\/pre>\n<p>Install the certbot snap with the following command.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo snap install --classic certbot\n<\/pre>\n<p><a href=\"https:\/\/linuxandotherstuff.net\/wp-content\/uploads\/2022\/10\/2022-10-27_09-50-19.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6977\" src=\"https:\/\/linuxandotherstuff.net\/wp-content\/uploads\/2022\/10\/2022-10-27_09-50-19.png\" alt=\"\" width=\"486\" height=\"20\" srcset=\"https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-27_09-50-19.png 486w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-27_09-50-19-300x12.png 300w\" sizes=\"auto, (max-width: 486px) 100vw, 486px\" \/><\/a><\/p>\n<p>This installation process will install the certbot executable in the \/snap\/bin\/ directory. Create a symbolic link to this file in the \/usr\/bin\/ directory to ensure that you can run the certbot command anywhere on your system:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo ln -s \/snap\/bin\/certbot \/usr\/bin\/certbot\n<\/pre>\n<p>Certbot is now ready to use, but in order for it to configure SSL for Apache, you need to verify that Apache has been configured correctly.<\/p>\n<p>Setting Up the SSL Certificate<\/p>\n<p>Open the virtual host file for your domain using nano or your favorite text editor:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo nano \/etc\/apache2\/sites-available\/yoursite.conf\n<\/pre>\n<p>Find the existing ServerName line.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/etc\/apache2\/sites-available\/yoursite.conf\n...\nServerName yoursite.com;\n...\n<\/pre>\n<p>Next, verify the syntax of your configuration edits:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo apache2ctl configtest\n<\/pre>\n<p>Output. You can ignore the warning message. Look for &#8220;Syntax OK&#8221;.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nAH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message\nSyntax OK\n<\/pre>\n<p>Certbot can now find the correct VirtualHost block and update it.<\/p>\n<p>Getting and Installing an SSL Certificate<\/p>\n<blockquote><p>Note: Make sure that the A record for the DNS is pointing to the server so Certbot can match the IP with the domain.<\/p><\/blockquote>\n<p>Certbot provides ways to obtain SSL certificates through plugins. The Apache plugin will take care of reconfiguring Apache and reloading the configuration. To use this plugin, run the following:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo certbot --apache -d yoursite.com -d www.yoursite.com\n<\/pre>\n<p>This runs certbot with the &#8211;apache plugin, using -d to specify the names for which you\u2019d like the certificate to be valid.<br \/>\nOutput:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nEnter email address (used for urgent renewal and security notices)\n (Enter 'c' to cancel): user@domain.com\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nPlease read the Terms of Service at\nhttps:\/\/letsencrypt.org\/documents\/LE-SA-v1.3-September-21-2022.pdf. You must\nagree in order to register with the ACME server. Do you agree?\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n(Y)es\/(N)o: y\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nWould you be willing, once your first certificate is successfully issued, to\nshare your email address with the Electronic Frontier Foundation, a founding\npartner of the Let's Encrypt project and the non-profit organization that\ndevelops Certbot? We'd like to send you email about our work encrypting the web,\nEFF news, campaigns, and ways to support digital freedom.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n(Y)es\/(N)o: n\nAccount registered.\nRequesting a certificate for yoursite.com and www.yoursite.com\nSuccessfully received certificate.\nCertificate is saved at: \/etc\/letsencrypt\/live\/yoursite.com\/fullchain.pem\nKey is saved at:         \/etc\/letsencrypt\/live\/yoursite.com\/privkey.pem\nThis certificate expires on 2023-01-25.\nThese files will be updated when the certificate renews.\nCertbot has set up a scheduled task to automatically renew this certificate in the background.\n\nDeploying certificate\nSuccessfully deployed certificate for ipgw.io to \/etc\/apache2\/sites-available\/yoursite.com-le-ssl.conf\nSuccessfully deployed certificate for www.ipgw.io to \/etc\/apache2\/sites-available\/yoursite.com-le-ssl.conf\nCongratulations! You have successfully enabled HTTPS on https:\/\/yoursite.com and https:\/\/www.yoursite.com\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nIf you like Certbot, please consider supporting our work by:\n * Donating to ISRG \/ Let's Encrypt:   https:\/\/letsencrypt.org\/donate\n * Donating to EFF:                    https:\/\/eff.org\/donate-le\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n<\/pre>\n<p>To check you can look at the site&#8217;s apache configuration file.<\/p>\n<p>Note above&#8230;<br \/>\nSuccessfully deployed certificate for ipgw.io to \/etc\/apache2\/sites-available\/yoursite.com-le-ssl.conf<br \/>\nSuccessfully deployed certificate for www.ipgw.io to \/etc\/apache2\/sites-available\/yoursite.com-le-ssl.conf<\/p>\n<p>Now you should reload the site and see the new ssl cert in action. You can also check the ssl at <a href=\"https:\/\/www.sslshopper.com\/ssl-checker.html\" target=\"_blank\" rel=\"noopener\">https:\/\/www.sslshopper.com\/ssl-checker.html<\/a><\/p>\n<p>If you need assistance, please contact our support at <a href=\"https:\/\/www.geekdecoder.com\/support\/\">Geekdecoder IT Support<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we are installing certbot on Debian 11 with Apache2 (Apache\/2.4.54 (Debian). This article assumes you have Apache installed. If not, see How To Install LAMP (Linux, Apache, MySql-Maria, PHP) On Debian 11.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-6970","post","type-post","status-publish","format-standard","hentry","category-apache"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6970","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=6970"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6970\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=6970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=6970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=6970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}