差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| linux:certbot_client [2019/02/15 12:06] – [Certbot クライアント] ともやん | 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 は / | ||
| 行 35: | 行 41: | ||
| Creating virtual environment... | Creating virtual environment... | ||
| Installing Python packages... | Installing Python packages... | ||
| - | </code> | + | Installation succeeded. |
| + | Saving debug log to / | ||
| + | Error while running apachectl configtest. | ||
| + | |||
| + | AH00526: Syntax error on line 101 of / | ||
| + | SSLCertificateFile: | ||
| + | |||
| + | Certbot doesn' | ||
| + | </ | ||
| </ | </ | ||
| + | |||
| ===== インストール ===== | ===== インストール ===== | ||
| - | <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: | ||
| 行 61: | 行 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 --agree-tos --webroot | + | $ sudo certbot certonly --webroot |
| + | </ | ||
| + | <WRAP color_result_long>< | ||
| Saving debug log to / | Saving debug log to / | ||
| Plugins selected: Authenticator webroot, Installer None | Plugins selected: Authenticator webroot, Installer None | ||
| Enter email address (used for urgent renewal and security notices) (Enter ' | Enter email address (used for urgent renewal and security notices) (Enter ' | ||
| cancel): tomoyan@tomoyan.net | cancel): tomoyan@tomoyan.net | ||
| + | |||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| + | Please read the Terms of Service at | ||
| + | https:// | ||
| + | agree in order to register with the ACME server at | ||
| + | https:// | ||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| + | (A)gree/ | ||
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| 行 79: | 行 172: | ||
| encrypting the web, EFF news, campaigns, and ways to support digital freedom. | encrypting the web, EFF news, campaigns, and ways to support digital freedom. | ||
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| - | (Y)es/ | + | (Y)es/ |
| Obtaining a new certificate | Obtaining a new certificate | ||
| Performing the following challenges: | Performing the following challenges: | ||
| - | http-01 challenge for tomoyan.net | + | http-01 challenge for monsters-g.com |
| - | Using the webroot path /var/www/html for all unmatched domains. | + | http-01 challenge for www.monsters-g.com |
| + | Using the webroot path /var/www/vhosts/ | ||
| Waiting for verification... | Waiting for verification... | ||
| Cleaning up challenges | Cleaning up challenges | ||
| - | Failed authorization procedure. tomoyan.net (http-01): urn: | ||
| IMPORTANT NOTES: | IMPORTANT NOTES: | ||
| - | | + | |
| + | / | ||
| + | Your key file has been saved at: | ||
| + | / | ||
| + | Your cert will expire on 2019-05-16. To obtain a new or tweaked | ||
| + | | ||
| + | | ||
| + | " | ||
| + | - If you like Certbot, please consider supporting our work by: | ||
| - | Domain: tomoyan.net | + | Donating to ISRG / Let's Encrypt: https:// |
| - | | + | Donating to EFF: https://eff.org/donate-le |
| - | Detail: Fetching | + | </pre></ |
| - | http://www.tomoyan.net.well-known/acme-challenge/V134KUuu24abYl4WMcicF22FOFrp7AxkOJHBkVzFA4c: | + | </ |
| - | Error getting validation data | + | |
| - | To fix these errors, please make sure that your domain name was | + | ===== 既に取得済みの証明書にサブドメインを追加 ===== |
| - | entered correctly and the DNS A/AAAA record(s) for that domain | + | **redmine.monsters-g.com** サブドメインを追加する場合、既存ドメインに **monsters-g.com**、**www.monsters-g.com** のあとに追記する🤔\\ |
| - | | + | コマンドラインでは、< |
| - | your computer has a publicly routable IP address and that no | + | <WRAP color_term> |
| - | | + | <WRAP color_command>< |
| - | | + | <b class=GRN> |
| - | that you are serving files from the webroot path you provided. | + | </ |
| - | | + | <WRAP color_result>< |
| - | configuration directory at / | + | 合計 3 |
| - | secure backup of this folder now. This configuration directory will | + | drwx------. 1 root root 88 8月 28 06:47 . |
| - | also contain certificates and private keys obtained by Certbot so | + | drwxr-xr-x. 1 root root 106 8月 28 06:47 .. |
| - | making regular backups of this folder is ideal. | + | -rw-r--r--. 1 root root 740 2月 15 2019 README |
| - | </code> | + | drwxr-xr-x |
| + | drwxr-xr-x. 1 root root 94 8月 28 06:15 tomoyan.net | ||
| + | </pre></ | ||
| </ | </ | ||
| - | < | + | < |
| - | <code> | + | <WRAP color_command>< |
| - | $ sudo certbot certonly --agree-tos --webroot -w /var/www/html/ -d monsters-g.com | + | <b class=GRN> |
| + | </ | ||
| + | <WRAP color_result>< | ||
| Saving debug log to / | 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 | Plugins selected: Authenticator webroot, Installer None | ||
| - | Obtaining a new certificate | + | Renewing an existing |
| Performing the following challenges: | Performing the following challenges: | ||
| http-01 challenge for monsters-g.com | http-01 challenge for monsters-g.com | ||
| - | Using the webroot path / | + | http-01 challenge |
| Waiting for verification... | Waiting for verification... | ||
| Cleaning up challenges | Cleaning up challenges | ||
| - | Failed authorization procedure. monsters-g.com (http-01): urn: | ||
| - | IMPORTANT NOTES: | + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| - | | + | new certificate deployed without reload, fullchain is |
| + | / | ||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| - | | + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| - | Type: connection | + | Processing / |
| - | Detail: Fetching | + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| - | | + | Cert is due for renewal, auto-renewing... |
| - | Error getting validation data | + | 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 | ||
| + | Waiting for verification... | ||
| + | Cleaning up challenges | ||
| - | To fix these errors, please make sure that your domain name was | + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| - | entered correctly and the DNS A/AAAA record(s) for that domain | + | new certificate deployed without reload, fullchain is |
| - | | + | /etc/ |
| - | your computer has a publicly routable IP address and that no | + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| - | firewalls are preventing the server from communicating with the | + | |
| - | client. If you're using the webroot plugin, you should also verify | + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| - | that you are serving files from the webroot path you provided. | + | |
| - | </code> | + | Congratulations, all renewals succeeded. The following certs have been renewed: |
| + | / | ||
| + | / | ||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| + | </ | ||
| </ | </ | ||
| + | |||
| + | 新しい証明書を反映させるために、Apache をリロードする😉\\ | ||
| + | <WRAP color_term> | ||
| + | <WRAP color_command>< | ||
| + | $ sudo systemctl reload httpd | ||
| + | </ | ||
| + | </ | ||
| + | |||