From 516f632b84bc418486538a2183564fe94b89097e Mon Sep 17 00:00:00 2001
From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>
Date: Tue, 1 Jul 2025 17:01:45 +0900
Subject: init
---
content/basic/certbot.md | 132 +++++++++++++++++++++++++++++
content/basic/dns.md | 95 +++++++++++++++++++++
content/basic/domain.md | 83 ++++++++++++++++++
content/basic/nginx.md | 213 +++++++++++++++++++++++++++++++++++++++++++++++
content/basic/server.md | 97 +++++++++++++++++++++
5 files changed, 620 insertions(+)
create mode 100644 content/basic/certbot.md
create mode 100644 content/basic/dns.md
create mode 100644 content/basic/domain.md
create mode 100644 content/basic/nginx.md
create mode 100644 content/basic/server.md
(limited to 'content/basic')
diff --git a/content/basic/certbot.md b/content/basic/certbot.md
new file mode 100644
index 0000000..f85c4db
--- /dev/null
+++ b/content/basic/certbot.md
@@ -0,0 +1,132 @@
+---
+title: "Certbot and HTTPS"
+date: 2021-07-13
+tags: ['basic']
+---
+Once you have a website, it is extremely important to enable encrypted
+connections over HTTPS/SSL. You might have no idea what that means, but
+it\'s easy to do now that we\'ve [set our web server up](/basic/nginx/).
+
+Certbot is a program that automatically creates and deploys the
+certificates that allow encrypted connections. It used to be painful
+(and often expensive) to do this, but now it\'s all free and automatic.
+
+## Why is encryption important?
+
+- With HTTPS, users\' ISPs cannot snoop on what they are looking at on
+ your website. They know that they have connected, but the particular
+ pages they visit are private as everything is encrypted. HTTPS
+ increases user privacy.
+- If you later create usernames and passwords for any service on your
+ site, lack of encryption can compromise that private data! Most
+ well-designed software will automatically *prevent* any unencrypted
+ connections over the internet.
+- Search engines like Google favor pages with HTTPS over unencrypted
+ HTTP.
+- You get the official-looking green 🔒 symbol in the URL bar in most
+ browsers which makes normies subtly trust your site more.
+
+## Let\'s do it!
+
+{{< img alt="website without https/ssl" src="/pix/nginx-website.png" link="/pix/nginx-website.png" >}}
+
+Note in this picture that a browser accessing your site will say \"Not
+secure\" or something else to notify you that we are using an
+unencrypted HTTP connection rather than an encrypted HTTPS one.
+
+## Installation
+
+Just run:
+
+```sh
+apt install python3-certbot-nginx
+```
+
+And this will install `certbot` and its module for `nginx`.
+
+## Run
+
+As I mentioned in the previous article, firewalls might interfere with
+certbot, so you will want to either disable your firewall or at least
+ensure that it allows connections on ports 80 and 443:
+
+```sh
+ufw allow 80
+ufw allow 443
+```
+
+Now let\'s run certbot:
+
+```sh
+certbot --nginx
+```
+
+The command will ask you for your email. This is so when the
+certificates need to be renewed in three months, you will get an email
+about it. You can set the certificates to renew automatically, but it\'s
+a good idea to check it the first time to ensure it renewed properly.
+You can avoid giving your email by running the command with the
+`--register-unsafely-without-email` option as well.
+
+Agree to the terms, and optionally consent to give your email to the EFF
+(I recommend against this obviously).
+
+Once all that is done, it will ask you what domains you want a
+certificate for. You can just press enter to select all.
+
+{{< img alt="activate HTTPS for a site with certbot" src="/pix/certbot-01.png" link="/pix/certbot-01.png" >}}
+
+It will take a moment to create the certificate, but afterwards, you
+will be asked if you want to automatically redirect all connections to
+be encrypted. Since this is preferable, choose 2 to Redirect.
+
+{{< img alt="redirecting http to encrypted https with certbot" src="/pix/certbot-02.png" link="/pix/certbot-02.png" >}}
+
+### Checking for success
+
+You should now be able to go to your website and see that there is a
+🔒 lock icon or some other notification that you are now on an encrypted
+connection.
+
+{{< img alt="A 🔒 symbol symbolizing our new HTTPS layer for our website!" src="/pix/certbot-03.png" link="/pix/certbot-03.png" >}}
+
+## Setting up certificate renewal
+
+As I mentioned in passing, the Certbot certificates last for 3 months.
+To renew certificates, you just have to run `certbot --nginx renew` and
+it will renew any certificates close to expiry.
+
+Of course, you don\'t want to have to remember to log in to renew them
+every three months, so it\'s easy to tell the server to automatically
+run this command. We will use a [cronjob](/cron) for this. Run the
+following command:
+
+```sh
+crontab -e
+```
+
+There might be a little menu that pops up asking what text editor you
+prefer when you run this command. If you don\'t know how to use vim,
+choose `nano`, the first option.
+
+This `crontab` command will open up a file for editing. A crontab is a
+list of commands that your operating system will run automatically at
+certain times. We are going to tell it to automatically try to renew our
+certificates every month so we never have to.
+
+Create a new line at the end of the file and add this content:
+
+```txt
+0 0 1 * * certbot --nginx renew
+```
+
+Save the file and exit to activate this cronjob.
+
+For more on cron and crontabs please [click here!](/cron)
+
+You now have a live website on the internet. You can add to it what you
+wish.
+
+As you add content to your site, there are many other things you can
+also install linked on [the main page](/), and many more
+improvements, tweaks and bonuses.
diff --git a/content/basic/dns.md b/content/basic/dns.md
new file mode 100644
index 0000000..c281fff
--- /dev/null
+++ b/content/basic/dns.md
@@ -0,0 +1,95 @@
+---
+title: "Connect Your Domain and Server with DNS Records"
+date: 2021-07-07
+tags: ["basic"]
+---
+
+## The Gist
+
+Now that we have a [domain](/basic/domain) and a [server](/basic/server), we
+can connect the two using DNS records. DNS (domain name system) records
+are usually put into your registrar and direct people looking up your
+website to the server where your website and other things will be.
+
+Get your IPv4/IPv6 addresses from your VPS provider and put them into A/AAAA
+records on your registrar. Simple process, takes a minute, but here\'s a guide
+with a million images just so you know.
+
+## Open up your Registrar
+
+As before, we will be using any registrar of your choice and
+[Vultr](https://www.vultr.com/?ref=8384069-6G) as a server host. Go ahead and
+log into your accounts on both. Open up your registrar, or your registrar, and
+click on your domain and then a choice for \"DNS records.\" You'll want to see
+something like this on your registrar's site.
+
+{{< img alt="Blank records" src="/pix/dns-epik.png" link="/pix/dns-epik.png" >}}
+
+Note that we are on the \"External Hosts (A, AAAA)\" tab by default. There may
+be default settings set by your registrar. If there are, you can go ahead and
+delete them so they look clean like the picture above.
+
+**All we have to do now is get our IP addresses from Vultr and add new
+DNS records that will send connections to our server.**
+
+Keep the registrar tab open and open Vultr and we will copy-and-paste our IP
+addresses in.
+
+## Find your server\'s IP addresses
+
+Looking at your server in the Vultr menu, you should see a number next
+to it. Mine here is `104.238.126.105` as you can see below the server
+name (which I have named `chad.thesiah.xyz` after the domain I will soon
+attach to it). That is my **IPv4** address.
+
+{{< img src="/pix/dns-ipv4.png" alt="See the IPv4 address?" link="/pix/dns-ipv4.png" >}}
+
+Copy your IPv4 address and on your registrar's site, click the \"Add Record\"
+record button and add two A entries pasting in your IPv4 address like I\'ve
+done for mine here.
+
+{{< img src="/pix/dns-ipv4-done.png" alt="IPv4 complete" link="/pix/dns-ipv4-done.png" >}}
+
+I add two entries. One has nothing written in the \"Host\" section. This
+will direct connections to `chad.thesiah.xyz` over IPv4 to our IP address.
+The second has a `*` in the \"Host\" section. This will direct
+connections to all possible subdomains to the right place too, I mean
+`mail.thesiah.xyz` or `blog.thesiah.xyz` and any other subdomain we
+might want to add later.
+
+Now let\'s get our IPv6 address, which is a little more hidden for some
+reason. IPv6 is important because we are running out of IPv4 addresses,
+so it is highly important to allow connections via IPv6 as it will be
+standard in the future. Anyway, now back on Vultr, click on the server
+name.
+
+On the server settings, **click on settings** and we will see we are on
+a submenu labeled \"IPv4\" where we see our IPv4 address again.
+
+{{< img src="/pix/dns-vultr.png" alt="Looking for the IPv6" link="/pix/dns-vultr.png" >}}
+
+Now just click on the **IPv6** submenu to reveal your IPv6 address.
+
+{{< img alt="The IPv6 address" src="/pix/dns-ipv6.png" link="/pix/dns-ipv6.png" >}}
+
+That ugly looking sequence of numbers and letters with colons in between
+(`2001:19f0:5:ccc:5400:03ff:fe58:324a`) is my **IPv6** address. Yours will look
+something like it. Now let\'s put it into your registrar's site. This time, be
+sure to select to put in AAAA records as below:
+
+{{< img src="/pix/dns-ipv6-done.png" alt="IPv6 complete" link="/pix/dns-ipv6-done.png" >}}
+
+Now just click \"Save Changes.\" It might take a minute for the DNS
+settings to propagate across the internet.
+
+## Test it out!
+
+Now we should have our domain name directing to our new server. We can
+check by pinging our domain name, check this out:
+
+{{< img src="/pix/dns-ping.png" alt="Pinging chat.thesiah.xyz" link="/pix/dns-ping.png" >}}
+
+As you can see, our ping to `chad.thesiah.xyz` is now being directed to
+`104.238.128.105`. That means we have successfully set up our DNS
+records! You can also run the command `host` if you have it, which will
+list both IPv4 and IPv6 addresses for a domain name.
diff --git a/content/basic/domain.md b/content/basic/domain.md
new file mode 100644
index 0000000..6a04b9c
--- /dev/null
+++ b/content/basic/domain.md
@@ -0,0 +1,83 @@
+---
+title: "Get a Domain Name"
+tags: ["basic"]
+date: 2021-06-01
+---
+
+## Terms
+
+Domain name
+: The name of a website that you type in an address bar. This site\'s
+domain name is `chad.thesiah.xyz`.
+
+Top-level domain (TLD)
+: The extension of a domain name, like `.com`, `.net`, `.xyz`, etc.
+
+Registrar
+: A service authorized to reserve a domain name for you.
+
+When domain names first sell, they usually sell for very cheap, but once
+someone buys one, they have the rights to it until they decide to sell
+it, often for much, much more money. Therefore, it\'s a good idea to
+reserve a domain name ASAP, even if you didn\'t intend on doing anything
+big with it.
+
+So let\'s register your domain name!
+
+## How
+
+Domains can be registered at any accredited registrar and there are
+[a lot to choose from](https://www.icann.org/en/accredited-registrars). Some major names are
+[Host Gator](https://www.hostgator.com/domains),
+[Blue Host](https://www.bluehost.com/domains),
+[Name Cheap](https://www.namecheap.com/domains/) or
+[Dream Host](https://www.dreamhost.com/domains/).
+
+There are also sites that are more private, like [Njalla](https://njal.la/) and
+[Cheap Privacy](https://cheapprivacy.ru/), which register a domain for you
+under their name, but still allow you access to it. (Normally all websites must
+be registered with the ICANN with a real name and address, but these sites
+allow you to bypass that.)
+
+Choosing a registrar is not permanent, and you can transfer domains to a
+different registrar if you get a better deal later, so in most cases, you can just
+choose one and let's head on...
+
+### Basic info about domain names
+
+- Domain names usually require a _very_ small yearly fee to keep
+ registered, usually around \$12 for most generic TLDs. There are
+ some \"specialty\" TLDs that are more expensive, but `.com`, `.xyz`
+ and other basic TLDs are that cheap.
+- Once you own a domain, it is yours as long as you pay the yearly
+ fee, but you can also sell it to someone for however much you want.
+- Domain names do not hold your data or your website; instead, you add
+ \"DNS settings\" that direct people connecting to your domain to
+ your IP address. The purpose of a domain name is so that people
+ don\'t have to remember your IP address to find your website!
+
+### Looking for domain names
+
+Let\'s go to our registrar's site and you can search for domain names.
+
+You can look for whatever domain name you want. Domains that are already
+bought and owned by someone else might have the option to \"Backorder,\"
+but it\'s always best to get one that is unowned, like these:
+
+{{< img alt="Searching for a domain name" src="/pix/domain-search.png" link="/pix/domain-search.png" >}}
+
+Note the differences in prices. Some \"specialty\" TLDs like `.game` and
+`.io` charge a much larger fee, although you might want one. Some
+domains above, like `.xyz` and `.org` have reduced prices for the first
+year.
+
+Choose the domain you want and buy it. These `.xyz` domains are a steal
+now on sale.
+
+{{< img alt="Buying a domain name" src="/pix/domain-cart.png" link="/pix/domain-cart.png" >}}
+
+That\'s all you have to do to own a domain name! As you register a
+domain, you can also setup an automatic payment to pay your fee yearly
+to keep your domain. Easy as pie.
+
+Now we will get a server to host your website on.
diff --git a/content/basic/nginx.md b/content/basic/nginx.md
new file mode 100644
index 0000000..ed2172f
--- /dev/null
+++ b/content/basic/nginx.md
@@ -0,0 +1,213 @@
+---
+title: "Setting Up an NginX Webserver"
+date: 2021-07-10
+tags: ["basic"]
+---
+
+At this point, we should have a domain name and a server and the domain
+name should direct to the IP address of the server with DNS records. As
+I said in previous articles, the instructions I will give will be for
+**Debian**. In this article, other distributions might work a little
+differently.
+
+## Logging in to the server
+
+We first want to log into our VPS to get a command prompt where we can
+set up the web server. I am assuming you are using either MacOS or
+GNU/Linux and you know how to open a terminal. On Windows, you can also
+use either PuTTY or the Windows Subsystem for Linux.
+
+Now on Vultr\'s site, you can click on your VPS and you will see that
+there is an area that shows you the password for your server at the
+bottom here.
+
+{{< img alt="Find your password" src="/pix/nginx-password.png" link="/pix/nginx-password.png" >}}
+
+Now pull up a terminal and type:
+
+```sh
+ssh root@{{
This is my website. Thanks for stopping by!
+Now my website is live!
+``` + +### Enable the site {#enable} + +Once you save that file, we can enable it making a link to it in the +`sites-enabled` directory: + +```sh +ln -s /etc/nginx/sites-available/{{