diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-05-19 23:46:22 +0100 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-05-19 23:46:22 +0100 |
| commit | 62243cd0b5262e14df7e7b5b7103b5b2e006cab5 (patch) | |
| tree | 2efe608a92f42aca3c372712fc14d4ae10fcec72 /www/posts/gemini | |
| parent | bbf7974715b9a43bab207df75ef69209cdf13850 (diff) | |
Add more to css
Diffstat (limited to 'www/posts/gemini')
| -rw-r--r-- | www/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/index.html | 33 | ||||
| -rw-r--r-- | www/posts/gemini/atom.xml | 28 | ||||
| -rw-r--r-- | www/posts/gemini/index.html | 7 |
3 files changed, 39 insertions, 29 deletions
diff --git a/www/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/index.html b/www/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/index.html index f92d177..b918199 100644 --- a/www/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/index.html +++ b/www/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/index.html @@ -5,6 +5,9 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <title>How to Host Your Own Gemini Site in the Cloud</title> <link rel="shortcut icon" href="/images/favicon.png"> + <link rel="stylesheet" href="/css/modern-normalize.min.css"> + <link rel="stylesheet" href="/css/highlight.min.css"> + <link rel="stylesheet" href="/css/railscasts.css"> <link rel="stylesheet" href="/css/site.css"> <link href="/posts/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts"/> <link href="/posts/arch/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Arch"/> @@ -28,12 +31,12 @@ $ ufw enable</code></pre><h3>Harden SSH</h3><p>I edited the /etc/ssh/sshd_config PasswordAuthentication no</pre><p>Since I'd made changes to the configuration I needed to restart the SSH service.</p><pre><code class="shell">$ service sshd restart</code></pre><h3>Create non-root User</h3><p>Whenever I access a server I like to login as a non-root user that is able to run sudo on the system.</p><pre><code class="shell">$ adduser gemini $ usermod -aG sudo gemini</code></pre><p>As the SSH key is already on the server I can copy it to the non-root user account.</p><pre><code class="shell">$ rsync --archive --chown=gemini:gemini ~/.ssh /home/gemini</code></pre><p>On my local system I confirm that I can log in as the new user without a password.</p><pre><code class="shell">$ ssh gemini@davidtsadler.co.uk -i ~/.ssh/davidtsadler.co.uk/id_rsa</code></pre><p>I also confirm that I have sudo access.</p><pre><code class="shell">$ sudo ls</code></pre><h2>Installing a Gemini Site and Server</h2><h3>Directory structure</h3><p>I decided to go with a very simple directory structure. Each site will be a sub-directory in ~/sites that will be named after the domain name. Then each site will have the following sub-directories. The idea is that I may want to host more than one site in the future.</p><ul><li>bin This will contain the Gemini server binary.</li><li>certs TLS certificates for the site are kept here.</li><li>public This will contain the .gmi files of the site.</li><li>scripts Contains scripts used to start the Gemini server.</li></ul><p>I created the directory structure with the below command.</p><pre><code class="shell">$ mkdir -p ~/sites/davidtsadler.co.uk/{bin,certs,public,scripts}</code></pre><h3>Install certificates</h3><p>Sine the Gemini protocol encourages using a self-signed certificate I installed one with the openssl command.</p><pre><code class="shell">$ openssl req -x509 \ --newkey rsa:4096 \ --keyout ~/sites/davidtsadler.co.uk/certs/key.rsa \ --out ~/sites/davidtsadler.co.uk/certs/cert.pem \ --days 3650 \ --nodes \ --subj "/CN=davidtsadler.co.uk"</code></pre><h3>Create Some Test Content</h3><p>I created a very simple index.gmi file purely for testing.</p><pre><code class="shell">$ cat << EOF > ~/sites/davidtsadler.co.uk/public/index.gmi + -newkey rsa:4096 \ + -keyout ~/sites/davidtsadler.co.uk/certs/key.rsa \ + -out ~/sites/davidtsadler.co.uk/certs/cert.pem \ + -days 3650 \ + -nodes \ + -subj "/CN=davidtsadler.co.uk"</code></pre><h3>Create Some Test Content</h3><p>I created a very simple index.gmi file purely for testing.</p><pre><code class="shell">$ cat << EOF > ~/sites/davidtsadler.co.uk/public/index.gmi # Welcome Hello world! @@ -49,13 +52,13 @@ $ chmod u+x agate</code></pre><p>I wrote a very simple bash script to run agate #!/bin/bash /home/gemini/sites/davidtsadler.co.uk/bin/agate \ ---content /home/gemini/sites/davidtsadler.co.uk/public/ \ ---key /home/gemini/sites/davidtsadler.co.uk/certs/key.rsa \ ---cert /home/gemini/sites/davidtsadler.co.uk/certs/cert.pem \ ---addr [::]:1965 \ ---addr 0.0.0.0:1965 \ ---hostname davidtsadler.co.uk \ ---lang en-GB + --content /home/gemini/sites/davidtsadler.co.uk/public/ \ + --key /home/gemini/sites/davidtsadler.co.uk/certs/key.rsa \ + --cert /home/gemini/sites/davidtsadler.co.uk/certs/cert.pem \ + --addr [::]:1965 \ + --addr 0.0.0.0:1965 \ + --hostname davidtsadler.co.uk \ + --lang en-GB EOF $ chmod u+x ~/sites/davidtsadler.co.uk/scripts/start</code></pre><h3>Testing the Site</h3><p>At this point I have the Gemini server installed and a site available for testing.</p><p>I first started agate with the bash script.</p><pre><code class="shell">$ ~/sites/davidtsadler.co.uk/scripts/start @@ -75,6 +78,8 @@ WantedBy=default.target</pre><p>I then started this service and confirmed it was $ sudo systemctl status agate.service -Active: active (running)</pre><p>The final step was to have this service start when the system is rebooted.</p><pre>$ sudo systemctl enable agate.service</pre><h2>Conclusion</h2><p>Setting up a Gemini site was easy to do and I hope this guide shows it. I have several ideas about how I'm going to use this new site and I'm excited to see where this leads to.</p><h3>Links</h3><a href="https://www.gandi.net/">Gandi.net - My domain registrar of choice.</a><a href="https://hetzner.cloud/?ref=Gf3UFbRaixBK">Hetzner - My cloud server provider.</a><a href="https://github.com/mbrubeck/agate/">Agate - A simple Gemini server.</a><a href="gemini://davidtsadler.co.uk/">davidtsadler.co.uk - My Gemini site.</a><a href="/posts/gemini/">Gemini - 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><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> +Active: active (running)</pre><p>The final step was to have this service start when the system is rebooted.</p><pre>$ sudo systemctl enable agate.service</pre><h2>Conclusion</h2><p>Setting up a Gemini site was easy to do and I hope this guide shows it. I have several ideas about how I'm going to use this new site and I'm excited to see where this leads to.</p><h3>Links</h3><a href="https://www.gandi.net/">Gandi.net - My domain registrar of choice.</a><a href="https://hetzner.cloud/?ref=Gf3UFbRaixBK">Hetzner - My cloud server provider.</a><a href="https://github.com/mbrubeck/agate/">Agate - A simple Gemini server.</a><a href="gemini://davidtsadler.co.uk/">davidtsadler.co.uk - My Gemini site.</a><a href="/posts/gemini/">Gemini - 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> + <script src="/js/highlight.min.js"></script> + <script src="/js/site.js"></script> </body> </html> diff --git a/www/posts/gemini/atom.xml b/www/posts/gemini/atom.xml index 79ac301..7359329 100644 --- a/www/posts/gemini/atom.xml +++ b/www/posts/gemini/atom.xml @@ -22,12 +22,12 @@ $ ufw enable</code></pre><h3>Harden SSH</h3><p>I edited the /etc/ssh/sshd_config PasswordAuthentication no</pre><p>Since I'd made changes to the configuration I needed to restart the SSH service.</p><pre><code class="shell">$ service sshd restart</code></pre><h3>Create non-root User</h3><p>Whenever I access a server I like to login as a non-root user that is able to run sudo on the system.</p><pre><code class="shell">$ adduser gemini $ usermod -aG sudo gemini</code></pre><p>As the SSH key is already on the server I can copy it to the non-root user account.</p><pre><code class="shell">$ rsync --archive --chown=gemini:gemini ~/.ssh /home/gemini</code></pre><p>On my local system I confirm that I can log in as the new user without a password.</p><pre><code class="shell">$ ssh gemini@davidtsadler.co.uk -i ~/.ssh/davidtsadler.co.uk/id_rsa</code></pre><p>I also confirm that I have sudo access.</p><pre><code class="shell">$ sudo ls</code></pre><h2>Installing a Gemini Site and Server</h2><h3>Directory structure</h3><p>I decided to go with a very simple directory structure. Each site will be a sub-directory in ~/sites that will be named after the domain name. Then each site will have the following sub-directories. The idea is that I may want to host more than one site in the future.</p><ul><li>bin This will contain the Gemini server binary.</li><li>certs TLS certificates for the site are kept here.</li><li>public This will contain the .gmi files of the site.</li><li>scripts Contains scripts used to start the Gemini server.</li></ul><p>I created the directory structure with the below command.</p><pre><code class="shell">$ mkdir -p ~/sites/davidtsadler.co.uk/{bin,certs,public,scripts}</code></pre><h3>Install certificates</h3><p>Sine the Gemini protocol encourages using a self-signed certificate I installed one with the openssl command.</p><pre><code class="shell">$ openssl req -x509 \ --newkey rsa:4096 \ --keyout ~/sites/davidtsadler.co.uk/certs/key.rsa \ --out ~/sites/davidtsadler.co.uk/certs/cert.pem \ --days 3650 \ --nodes \ --subj "/CN=davidtsadler.co.uk"</code></pre><h3>Create Some Test Content</h3><p>I created a very simple index.gmi file purely for testing.</p><pre><code class="shell">$ cat << EOF > ~/sites/davidtsadler.co.uk/public/index.gmi + -newkey rsa:4096 \ + -keyout ~/sites/davidtsadler.co.uk/certs/key.rsa \ + -out ~/sites/davidtsadler.co.uk/certs/cert.pem \ + -days 3650 \ + -nodes \ + -subj "/CN=davidtsadler.co.uk"</code></pre><h3>Create Some Test Content</h3><p>I created a very simple index.gmi file purely for testing.</p><pre><code class="shell">$ cat << EOF > ~/sites/davidtsadler.co.uk/public/index.gmi # Welcome Hello world! @@ -43,13 +43,13 @@ $ chmod u+x agate</code></pre><p>I wrote a very simple bash script to run agate #!/bin/bash /home/gemini/sites/davidtsadler.co.uk/bin/agate \ ---content /home/gemini/sites/davidtsadler.co.uk/public/ \ ---key /home/gemini/sites/davidtsadler.co.uk/certs/key.rsa \ ---cert /home/gemini/sites/davidtsadler.co.uk/certs/cert.pem \ ---addr [::]:1965 \ ---addr 0.0.0.0:1965 \ ---hostname davidtsadler.co.uk \ ---lang en-GB + --content /home/gemini/sites/davidtsadler.co.uk/public/ \ + --key /home/gemini/sites/davidtsadler.co.uk/certs/key.rsa \ + --cert /home/gemini/sites/davidtsadler.co.uk/certs/cert.pem \ + --addr [::]:1965 \ + --addr 0.0.0.0:1965 \ + --hostname davidtsadler.co.uk \ + --lang en-GB EOF $ chmod u+x ~/sites/davidtsadler.co.uk/scripts/start</code></pre><h3>Testing the Site</h3><p>At this point I have the Gemini server installed and a site available for testing.</p><p>I first started agate with the bash script.</p><pre><code class="shell">$ ~/sites/davidtsadler.co.uk/scripts/start @@ -69,6 +69,6 @@ WantedBy=default.target</pre><p>I then started this service and confirmed it was $ sudo systemctl status agate.service -Active: active (running)</pre><p>The final step was to have this service start when the system is rebooted.</p><pre>$ sudo systemctl enable agate.service</pre><h2>Conclusion</h2><p>Setting up a Gemini site was easy to do and I hope this guide shows it. I have several ideas about how I'm going to use this new site and I'm excited to see where this leads to.</p><h3>Links</h3><a href="https://www.gandi.net/">Gandi.net - My domain registrar of choice.</a><a href="https://hetzner.cloud/?ref=Gf3UFbRaixBK">Hetzner - My cloud server provider.</a><a href="https://github.com/mbrubeck/agate/">Agate - A simple Gemini server.</a><a href="gemini://davidtsadler.co.uk/">davidtsadler.co.uk - My Gemini site.</a><a href="/posts/gemini/">Gemini - 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><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>]]</content> +Active: active (running)</pre><p>The final step was to have this service start when the system is rebooted.</p><pre>$ sudo systemctl enable agate.service</pre><h2>Conclusion</h2><p>Setting up a Gemini site was easy to do and I hope this guide shows it. I have several ideas about how I'm going to use this new site and I'm excited to see where this leads to.</p><h3>Links</h3><a href="https://www.gandi.net/">Gandi.net - My domain registrar of choice.</a><a href="https://hetzner.cloud/?ref=Gf3UFbRaixBK">Hetzner - My cloud server provider.</a><a href="https://github.com/mbrubeck/agate/">Agate - A simple Gemini server.</a><a href="gemini://davidtsadler.co.uk/">davidtsadler.co.uk - My Gemini site.</a><a href="/posts/gemini/">Gemini - 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>]]</content> </entry> </feed>
\ No newline at end of file diff --git a/www/posts/gemini/index.html b/www/posts/gemini/index.html index 7e4cfe9..ccf86af 100644 --- a/www/posts/gemini/index.html +++ b/www/posts/gemini/index.html @@ -5,6 +5,9 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <title>The Home of David T. Sadler - All Posts About Gemini</title> <link rel="shortcut icon" href="/images/favicon.png"> + <link rel="stylesheet" href="/css/modern-normalize.min.css"> + <link rel="stylesheet" href="/css/highlight.min.css"> + <link rel="stylesheet" href="/css/railscasts.css"> <link rel="stylesheet" href="/css/site.css"> <link href="/posts/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts"/> <link href="/posts/arch/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Arch"/> @@ -18,6 +21,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>The Home of David T. Sadler - All Posts About Gemini</h1><a href="/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/">2021-02-08 - How to Host Your Own Gemini Site in the Cloud</a><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>The Home of David T. Sadler - All Posts About Gemini</h1><a href="/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/">2021-02-08 - How to Host Your Own Gemini Site in the Cloud</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 src="/js/highlight.min.js"></script> + <script src="/js/site.js"></script> </body> </html> |
