summaryrefslogtreecommitdiff
path: root/www/posts/letsencrypt/2021-05-27/wildcard-certificates-with-lets-encrypt/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'www/posts/letsencrypt/2021-05-27/wildcard-certificates-with-lets-encrypt/index.html')
-rw-r--r--www/posts/letsencrypt/2021-05-27/wildcard-certificates-with-lets-encrypt/index.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/www/posts/letsencrypt/2021-05-27/wildcard-certificates-with-lets-encrypt/index.html b/www/posts/letsencrypt/2021-05-27/wildcard-certificates-with-lets-encrypt/index.html
index 8228b70..3ca0cb8 100644
--- a/www/posts/letsencrypt/2021-05-27/wildcard-certificates-with-lets-encrypt/index.html
+++ b/www/posts/letsencrypt/2021-05-27/wildcard-certificates-with-lets-encrypt/index.html
@@ -18,8 +18,8 @@
<link href="/posts/php/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About PHP"/>
</head>
<body>
- <section><h1>Wildcard Certificates with Let's Encrypt</h1><blockquote>Thu 27th May 2021 By David T. Sadler.</blockquote><p>Currently my little bit of the internet is davidtsadler.com. However I have a few ideas for some other projects that I would like to host under a subdomain. For example at some point I want to make my source code available at git.davidtsadler.com. I also want SSL on each of the sites.</p><p>Since I'm self hosting my sites I can make use of Let's Encrypt to obtain the nessecary certificates. However I don't want the hassle of maintaing a seperate certificate for each site so I'm going with having a single wildcard certificate that will be valid for each subdomain.</p><p>Obtaining a wildcard certificate can be done with the certbot command.</p><pre><code class="shell">$ sudo certbot certonly --manual --preferred-challenges=dns --email me@email.com --agree-tos -d &quot;*.davidtsadler.com,davidtsadler.com&quot;</code></pre><ul><li>certonly This will obtain and save the certificate but will not install it. That is left to you.</li><li>--manual Obtains certificates interactively.</li><li>--preferred-challenges=dns Tells certbot that I will use the dns method to prove I own the domain name.</li><li>--email Email address used for registration and recovery contact.</li><li>--agree-tos Automatically agree to the terms of service.</li><li>-d Comma seperataed list of domain names that the certificate should cover.</li></ul><p>There are a couple of things to note with the above command. For starters I had to specifiy both *.davidtsadler and davidtsadler.com as the domains. This is because if I did not include davidtsadler.com then only subdomains would be covered by the certificate. In other words *.davidtsadler means any subdomain under davidtsadler.com but not the domain davidtsadler.com itself. </p><p>Secondaly, due to how my dns is been managed I could not have certbot automatically add the appropriate dns entries in order for it to validate the authenancy of the domain name. Instead certbot displayed the instructions needed to manually add two TXT records to my dns. Once I had done this certbot was happy that I owned the domain that the certificate would cover.</p><p>Running the certbot command results in the certificates been saved in /etc/letsencrypt/live/davidtsadler.com/</p><p>After that all I need to do is ensure that Apache has SSL support enabled and then add the below settings to my vhost file which tells Apache where to find the certificates.</p><pre>SSLCertificateFile /etc/letsencrypt/live/davidtsadler.com/fullchain.pem
-SSLCertificateKeyFile /etc/letsencrypt/live/davidtsadler.com/privkey.pem</pre><p>Now in future I can simply create the required vhost file for the new subdomain site and have it use the same certificate as the others.</p><h3>Links</h3><a href="https://davidtsadler.com">davidtsadler.com - My little bit of the internet.</a><a href="/posts/letsencrypt/">Let's Encrypt - Read More Posts.</a><p>I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.</p><a href="mailto:david@davidtsadler.com">Email david@davidtsadler.com</a><h3>License</h3><a href="https://creativecommons.org/licenses/by-sa/4.0/">The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a><p>Copyright © 2021 David T. Sadler.</p><a href="/">Return to Homepage.</a></section>
+ <section><h1>Wildcard Certificates with Let&#039;s Encrypt</h1><blockquote>Thu 27th May 2021 By David T. Sadler.</blockquote><p>Currently my little bit of the internet is davidtsadler.com. However I have a few ideas for some other projects that I would like to host under a subdomain. For example at some point I want to make my source code available at git.davidtsadler.com. I also want SSL on each of the sites.</p><p>Since I&#039;m self hosting my sites I can make use of Let&#039;s Encrypt to obtain the nessecary certificates. However I don&#039;t want the hassle of maintaing a seperate certificate for each site so I&#039;m going with having a single wildcard certificate that will be valid for each subdomain.</p><p>Obtaining a wildcard certificate can be done with the certbot command.</p><pre><code class="shell">$ sudo certbot certonly --manual --preferred-challenges=dns --email me@email.com --agree-tos -d &quot;*.davidtsadler.com,davidtsadler.com&quot;</code></pre><ul><li>certonly This will obtain and save the certificate but will not install it. That is left to you.</li><li>--manual Obtains certificates interactively.</li><li>--preferred-challenges=dns Tells certbot that I will use the dns method to prove I own the domain name.</li><li>--email Email address used for registration and recovery contact.</li><li>--agree-tos Automatically agree to the terms of service.</li><li>-d Comma seperataed list of domain names that the certificate should cover.</li></ul><p>There are a couple of things to note with the above command. For starters I had to specifiy both *.davidtsadler and davidtsadler.com as the domains. This is because if I did not include davidtsadler.com then only subdomains would be covered by the certificate. In other words *.davidtsadler means any subdomain under davidtsadler.com but not the domain davidtsadler.com itself. </p><p>Secondaly, due to how my dns is been managed I could not have certbot automatically add the appropriate dns entries in order for it to validate the authenancy of the domain name. Instead certbot displayed the instructions needed to manually add two TXT records to my dns. Once I had done this certbot was happy that I owned the domain that the certificate would cover.</p><p>Running the certbot command results in the certificates been saved in /etc/letsencrypt/live/davidtsadler.com/</p><p>After that all I need to do is ensure that Apache has SSL support enabled and then add the below settings to my vhost file which tells Apache where to find the certificates.</p><pre>SSLCertificateFile /etc/letsencrypt/live/davidtsadler.com/fullchain.pem
+SSLCertificateKeyFile /etc/letsencrypt/live/davidtsadler.com/privkey.pem</pre><p>Now in future I can simply create the required vhost file for the new subdomain site and have it use the same certificate as the others.</p><h3>Links</h3><a href="https://davidtsadler.com">davidtsadler.com - My little bit of the internet.</a><a href="/posts/letsencrypt/">Let&#039;s Encrypt - Read More Posts.</a><p>I don&#039;t have comments as I don&#039;t want to manage them. You can however contact me at the below address if you want to.</p><a href="mailto:david@davidtsadler.com">Email david@davidtsadler.com</a><h3>License</h3><a href="https://creativecommons.org/licenses/by-sa/4.0/">The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a><p>Copyright © 2021 David T. Sadler.</p><a href="/">Return to Homepage.</a></section>
<script defer src="/js/highlight.min.js"></script>
<script defer src="/js/site.js"></script>
</body>