概要
wslでubuntu、やってみた。
certbot入れてみた。
バージョン確認
wsl -l -v
NAME STATE VERSION
* Ubuntu-18.04 Stopped 1
uname -a
Linux DESKTOP-SQ2TVUK 4.4.0-19041-Microsoft #1237-Microsoft Sat Sep 11 14:32:00 PST 2021 x86_64 x86_64 x86_64 GNU/Linux
cat /proc/version
Linux version 4.4.0-19041-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1237-Microsoft Sat Sep 11 14:32:00 PST 2021
cat /etc/debian_version
buster/sid
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
sudo確認
sudo ls
apt-get update
sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2067 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2414 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [366 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [610 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [82.8 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1172 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [459 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [634 kB]
Get:13 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [269 kB]
Get:14 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [17.6 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [86.5 kB]
Get:16 http://security.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [3660 B]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1786 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [387 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [24.2 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [5980 B]
Get:21 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [10.3 kB]
Get:22 http://archive.ubuntu.com/ubuntu bionic-backports/main Translation-en [4824 B]
Get:23 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [11.3 kB]
Get:24 http://archive.ubuntu.com/ubuntu bionic-backports/universe Translation-en [5772 B]
Fetched 10.7 MB in 43s (249 kB/s)
Reading package lists... Done
certbotインストール
sudo apt-get install certbot
certbot --version
certbot 0.27.0
Let's Encrypt のドメイン名の所有確認方法
- http-01チャレンジ
Let's Encrypt サーバからトークンを取得し、このトークンを含むファイルを対象ドメイン名の web サーバ上の特定のディレクトリに置くことでドメイン名の所有確認を行います。
たとえば「example.com」の証明書を発行する場合、http://example.com/.well-known/acme-challenge/(取得したトークン)という URL にファイルを設置する必要があります。
- dns-01チャレンジ
Let's Encrypt サーバから取得したトークンを、対象ドメイン名の権威 DNS サーバに登録することで所有確認を行います。
たとえば「example.com」の証明書を発行する場合、DNS サーバに_acme-challenge.example.com. IN TXT "(取得したトークンを元に生成したハッシュ値)"というレコードを設定します。
以上。