差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
linux:certbot_client [2019/02/15 14:52] – [証明書取得の実行] ともやん | linux:certbot_client [2025/04/23 07:14] (現在) – [Certbot クライアント] ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
====== Certbot クライアント ====== | ====== Certbot クライアント ====== | ||
+ | Certbot は Electronic Frontier 財団が開発した ACME クライアントで Python で書かれている🤔\\ | ||
+ | [[arc> | ||
- | ===== Fedora | + | ACME (自動証明書管理環境) は、認証機関 (CA) が署名する X.509 証明書を自動化するために、インターネット標準 ([[https:// |
- | <code> | + | |
+ | [[https:// | ||
+ | |||
+ | ===== Fedora でのインストール ===== | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
$ sudo -s | $ sudo -s | ||
# cd ~ | # cd ~ | ||
行 9: | 行 16: | ||
# chmod a+x certbot-auto | # chmod a+x certbot-auto | ||
# ./ | # ./ | ||
- | </code> | + | </pre></ |
- | < | + | <WRAP color_result>< |
- | <code> | + | |
Bootstrapping dependencies for RedHat-based OSes... (you can skip this with --no-bootstrap) | Bootstrapping dependencies for RedHat-based OSes... (you can skip this with --no-bootstrap) | ||
dnf は / | dnf は / | ||
行 43: | 行 49: | ||
Certbot doesn' | Certbot doesn' | ||
- | </code> | + | </pre></ |
</ | </ | ||
+ | |||
===== インストール ===== | ===== インストール ===== | ||
- | <code> | + | <WRAP color_term> |
+ | <WRAP color_command>< | ||
$ sudo dnf install certbot python-certbot-apache | $ sudo dnf install certbot python-certbot-apache | ||
- | </code> | + | </pre></ |
+ | </ | ||
+ | |||
+ | ===== 使用方法 [--help] ===== | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | $ certbot --help | ||
+ | </ | ||
+ | <WRAP color_result_long>< | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | |||
+ | certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ... | ||
+ | |||
+ | Certbot can obtain and install HTTPS/ | ||
+ | it will attempt to use a webserver both for obtaining and installing the | ||
+ | certificate. The most common SUBCOMMANDS and flags are: | ||
+ | |||
+ | obtain, install, and renew certificates: | ||
+ | (default) run | ||
+ | certonly | ||
+ | renew Renew all previously obtained certificates that are near | ||
+ | expiry | ||
+ | enhance | ||
+ | -d DOMAINS | ||
+ | |||
+ | (the certbot apache plugin is not installed) | ||
+ | --standalone | ||
+ | (the certbot nginx plugin is not installed) | ||
+ | --webroot | ||
+ | --manual | ||
+ | hooks | ||
+ | |||
+ | | ||
+ | --test-cert | ||
+ | --dry-run | ||
+ | to disk | ||
+ | |||
+ | manage certificates: | ||
+ | certificates | ||
+ | revoke | ||
+ | delete | ||
+ | |||
+ | manage your account: | ||
+ | register | ||
+ | unregister | ||
+ | update_account | ||
+ | show_account | ||
+ | --agree-tos | ||
+ | -m EMAIL Email address for important account notifications | ||
+ | |||
+ | More detailed help: | ||
+ | |||
+ | -h, --help [TOPIC] | ||
+ | the available TOPICS are: | ||
+ | |||
+ | all, automation, commands, paths, security, testing, or any of the | ||
+ | | ||
+ | | ||
+ | -h all print a detailed help page including all topics | ||
+ | --version | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | </ | ||
+ | </WRAP> | ||
===== テスト実行 ===== | ===== テスト実行 ===== | ||
- | < | + | < |
- | <code> | + | <WRAP color_command>< |
$ sudo certbot | $ sudo certbot | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
Saving debug log to / | Saving debug log to / | ||
Certbot doesn' | Certbot doesn' | ||
$ sudo less / | $ sudo less / | ||
- | </code> | + | </pre></ |
</ | </ | ||
- | < | + | |
- | <file / | + | < |
+ | <WRAP color_mincode> | ||
2019-02-15 11: | 2019-02-15 11: | ||
2019-02-15 11: | 2019-02-15 11: | ||
行 69: | 行 143: | ||
2019-02-15 11: | 2019-02-15 11: | ||
2019-02-15 11: | 2019-02-15 11: | ||
- | </ | + | </file></ |
</ | </ | ||
===== 証明書取得の実行 ===== | ===== 証明書取得の実行 ===== | ||
- | < | + | < |
- | <code> | + | <WRAP color_command>< |
- | $ sudo certbot certonly --webroot -w / | + | $ sudo certbot certonly --webroot -w / |
+ | </ | ||
+ | <WRAP color_result_long>< | ||
Saving debug log to / | Saving debug log to / | ||
行 101: | 行 177: | ||
http-01 challenge for monsters-g.com | http-01 challenge for monsters-g.com | ||
http-01 challenge for www.monsters-g.com | http-01 challenge for www.monsters-g.com | ||
- | Using the webroot path / | + | Using the webroot path / |
Waiting for verification... | Waiting for verification... | ||
Cleaning up challenges | Cleaning up challenges | ||
行 118: | 行 194: | ||
| | ||
| | ||
- | </code> | + | </pre></ |
</ | </ | ||
+ | |||
+ | ===== 既に取得済みの証明書にサブドメインを追加 ===== | ||
+ | **redmine.monsters-g.com** サブドメインを追加する場合、既存ドメインに **monsters-g.com**、**www.monsters-g.com** のあとに追記する🤔\\ | ||
+ | コマンドラインでは、< | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | 合計 3 | ||
+ | drwx------. 1 root root 88 8月 28 06:47 . | ||
+ | drwxr-xr-x. 1 root root 106 8月 28 06:47 .. | ||
+ | -rw-r--r--. 1 root root 740 2月 15 2019 README | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x. 1 root root 94 8月 28 06:15 tomoyan.net | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | Saving debug log to / | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | An RSA certificate named monsters-g.com already exists. Do you want to update | ||
+ | its key type to ECDSA? | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | (U)pdate key type/(K)eep existing key type: u | ||
+ | Renewing an existing certificate for monsters-g.com and 2 more domains | ||
+ | |||
+ | Successfully received certificate. | ||
+ | Certificate is saved at: / | ||
+ | Key is saved at: / | ||
+ | This certificate expires on 2023-07-02. | ||
+ | These files will be updated when the certificate renews. | ||
+ | Certbot has set up a scheduled task to automatically renew this certificate in the background. | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | If you like Certbot, please consider supporting our work by: | ||
+ | * Donating to ISRG / Let's Encrypt: | ||
+ | * Donating to EFF: https:// | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Apache の場合は、新しく取得した証明書を有効化する為にリロードする🤔\\ | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== 証明書更新テストの実行 ===== | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | $ sudo certbot renew --dry-run | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | Saving debug log to / | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | Processing / | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | Simulating renewal of an existing certificate for monsters-g.com and www.monsters-g.com | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | Processing / | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | Simulating renewal of an existing certificate for tomoyan.net and 3 more domains | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | Congratulations, | ||
+ | / | ||
+ | / | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== 証明書更新の実行 ===== | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | $ sudo certbot renew | ||
+ | </ | ||
+ | <WRAP color_result_long>< | ||
+ | Saving debug log to / | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | Processing / | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | Cert is due for renewal, auto-renewing... | ||
+ | Plugins selected: Authenticator webroot, Installer None | ||
+ | Renewing an existing certificate | ||
+ | Performing the following challenges: | ||
+ | http-01 challenge for monsters-g.com | ||
+ | http-01 challenge for www.monsters-g.com | ||
+ | Waiting for verification... | ||
+ | Cleaning up challenges | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | new certificate deployed without reload, fullchain is | ||
+ | / | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | Processing / | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | Cert is due for renewal, auto-renewing... | ||
+ | Plugins selected: Authenticator webroot, Installer None | ||
+ | Renewing an existing certificate | ||
+ | Performing the following challenges: | ||
+ | http-01 challenge for redmine.tomoyan.net | ||
+ | http-01 challenge for repos.tomoyan.net | ||
+ | http-01 challenge for tomoyan.net | ||
+ | http-01 challenge for www.tomoyan.net | ||
+ | Waiting for verification... | ||
+ | Cleaning up challenges | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | new certificate deployed without reload, fullchain is | ||
+ | / | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | |||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | |||
+ | Congratulations, | ||
+ | / | ||
+ | / | ||
+ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | 新しい証明書を反映させるために、Apache をリロードする😉\\ | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | $ sudo systemctl reload httpd | ||
+ | </ | ||
+ | </ | ||
+ | |||