Linux
Mac OS
VMware
OpenWrt
ソフトウェア開発
Linux
Mac OS
VMware
OpenWrt
ソフトウェア開発
文書の過去の版を表示しています。
セキュリティ向上のため、Let's Encrypt が発行する SSL 証明書を利用する。
パッケージ名 | バージョン |
---|---|
certbot | 0.31.0-1+ubuntu18.04.1+certbot+1 |
Certbot をインストールする。PPA を追加しなくても universe からインストールできるようだが、Let's Encrypt の公式が PPA 追加するように書いてあるので追加しておく。
$ sudo apt-get update $ sudo add-apt-repository ppa:certbot/certbot $ sudo apt-get update $ sudo apt-get install certbot
初回の SSL 証明書取得のために 80 ポートを Certbot が使用するので、他に Web サーバが起動している場合は停止しておく。
ファイアフォールで 80 ポートをブロックしている場合は、ポートを一時的に解放する。
$ sudo ufw allow 80/tcp
以下のコマンドで Certbot を設定する。
$ sudo certbot certonly --standalone
証明書の取得に成功すると以下のメッセージが表示される。
取得されたキーファイルは /etc/letsencrypt/live/hogepiyo.com/ の中に保存されている。(シンボリックリンクが置いてある)
Obtaining a new certificate Performing the following challenges: http-01 challenge for hogepiyo.com Waiting for verification... Cleaning up challenges IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/hogepiyo.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/hogepiyo.com/privkey.pem Your cert will expire on 2019-11-28. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
ポートを一時的に解放した場合は、もう一度閉じておく。
$ sudo ufw delete allow 80/tcp