Home
Packages
Forums
Wiki
GitLab
Security
AUR
Download
コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
目次
コミュニティに貢献
最近の出来事
おまかせ表示
特別ページ
交流
ヘルプ
貢献
最近の更新
最近の議論
新しいページ
統計
リクエスト
ArchWiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
Certbotのソースを表示
ページ
議論
日本語
閲覧
ソースを閲覧
履歴を表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを閲覧
履歴を表示
全般
リンク元
関連ページの更新状況
ページ情報
表示
サイドバーに移動
非表示
←
Certbot
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
[[Category:ネットワーク]] [[Category:セキュリティ]] [[en:Let’s Encrypt]] [https://letsencrypt.org/ Let’s Encrypt] はフリーかつ自動化されたオープンな認証局です。[[Wikipedia:ja:Automated Certificate Management Environment|ACME]] プロトコルを利用しています。 公式クライアントは '''Certbot''' という名前で、コマンドラインから有効な X.509 証明書を取得できます。また、手動で CSR 作成を行うミニマルなクライアントを {{AUR|acme-tiny}} でインストールすることができます。スクリプトで使用するのに適したクライアントとして {{AUR|simp_le-git}} や {{AUR|letsencrypt-cli}} も存在します。 == インストール == {{Pkg|certbot}} パッケージを[[インストール]]してください。 公式クライアントを用いて発行された証明書はプラグインを使ってウェブサーバーに自動的に設定・インストールできます: * [[Nginx]] 用の実験的なプラグインは {{Pkg|certbot-nginx}} パッケージに入っています。 * [[Apache HTTP Server]] 利用時の自動インストールは、{{Pkg|certbot-apache}} パッケージにより有効になっています。 == 設定 == 証明を作成・インストールする方法は [https://certbot.eff.org/docs/ Certbot のドキュメント] を参照してください。 === Webroot === {{Note| * Webroot 方式では、Certbotが検証するために、'''HTTP on port 80''' が必要です。 ** '''HTTPS on port 443''' を使用してCertbotを検証するには、Webroot('''--webroot''')メソッドの代わりにNginx('''--nginx''')またはApache('''--apache''')プラグインを使用する必要があります。 * サーバー名は、対応するDNSの名前と一致する必要があります。 * {{ic|http://domain.tld/.well-known}} への読み取りアクセスを許可するには、ホスト上でアクセス権を変更する必要があります。 }} webroot メソッドを使用する場合、certbotクライアントは検証のために使用される、{{ic|/path/to/domain.tld/html/.well-known/acme-challenge/}} の中でチャレンジ/レスポンス認証が行われます。 この使用方法は手動インストールよりも推奨されます。自動的に更新が行なわれ、証明書管理が容易になります。 {{Tip|1=以下の [Nginx#Server_blocks|nginx server]] 設定は、初めての証明書を取得するのに役立ちます: {{hc|/etc/nginx/servers-available/domain.tld| <nowiki> server { listen 80; listen [::]:80; server_name domain.tld; root /usr/share/nginx/html; location / { index index.htm index.html; } # ACME challenge location ^~ /.well-known/acme-challenge/ { default_type "text/plain"; root /var/lib/letsencrypt; } } </nowiki> }} }} ==== 証明書を取得する ==== {{ic|/var/lib/letsencrypt/}} を公開アクセス可能なパスとして使用して、{{ic|domain.tld}} の証明書を要求します: # certbot certonly --email '''email@example.com''' --webroot -w '''/var/lib/letsencrypt/''' -d '''domain.tld''' (サブ)ドメインを追加するには、現在のセットアップで使用されているすべての登録済みドメインを含めます: # certbot certonly --email '''email@example.com''' --webroot -w '''/var/lib/letsencrypt/''' -d '''domain.tld,sub.domain.tld''' 現在の証明書を(すべて)更新するには: # certbot renew 変わりのアプローチとして [[#自動更新]] を参照してください。 === 手動 === {{Note| * この方法では、一時的にウェブサーバーを停止する必要があります。[[#Webroot]] の方法ではウェブサーバーを実行しながらでも認証が行えます。 * この方法では、自動的に証明書を更新することはできません。自動更新を行いたい場合には、[[#Webroot]] メソッドを使用してください。}} ウェブサーバーのプラグインが存在しない場合、次のコマンドを使って下さい: # certbot certonly --manual DNS の TXT レコードを利用した認証を行う場合、次のコマンドを使って下さい: # certbot certonly --manual --preferred-challenges dns 上記のコマンドで自動的にドメインが認証されて秘密鍵と証明書のペアが作成されます。秘密鍵と証明書は {{ic|/etc/letsencrypt/live/''your.domain''/}} に保存されます。 上記のディレクトリに入っている秘密鍵と証明書を使用するように手動でウェブサーバーを設定します。 {{Note|コマンドを複数回実行すると {{ic|/etc/letsencrypt/live/''your.domain''/}} に作られるファイルの名前には末尾に数字が付加されます。作成されたファイル名かウェブサーバーの設定を書き換える必要があります。}} == 高度な設定 == === Webサーバーの設定 === 自動構成にプラグインを使用する代わりに、サーバーのSSLを手動で有効にすることをお勧めします。 {{Tip| * Mozilla has a useful [https://wiki.mozilla.org/Security/Server_Side_TLS SSL/TLS article] which includes an [https://mozilla.github.io/server-side-tls/ssl-config-generator/ automated tool] to help create a more secure configuration. * [https://cipherli.st Cipherli.st] provides strong SSL implementation examples and tutorial for most modern webservers. }} ==== nginx ==== Let's Encrypt の署名付きSSL証明書を使用したサーバー {{ic|domain.tld}} の例: {{hc|/etc/nginx/servers-available/domain.tld| <nowiki> # redirect to https server { listen 80; listen [::]:80; server_name domain.tld; return 301 https://$host$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/domain.tld/chain.pem; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; ssl_prefer_server_ciphers on; add_header Strict-Transport-Security max-age=15768000; ssl_stapling on; ssl_stapling_verify on; server_name domain.tld; .. } # A subdomain uses the same SSL-certifcate: server { listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/domain.tld/chain.pem; .. server_name sub.domain.tld; .. } # ACME challenge location ^~ /.well-known { allow all; alias /var/lib/letsencrypt/.well-known/; default_type "text/plain"; try_files $uri =404; } </nowiki> }} === マルチドメイン === Management of can be made easier by mapping all HTTP-requests for {{ic|/.well-known/acme-challenge/}} to a single folder, e.g. {{ic|/var/lib/letsencrypt}}. The path has then to be writable for the Let's Encrypt client and the web server (e.g. [[nginx]] or [[Apache]] running as user ''http''): # mkdir -p /var/lib/letsencrypt/.well-known # chgrp http /var/lib/letsencrypt # chmod g+s /var/lib/letsencrypt ==== nginx ==== locationブロックを含むファイルを作成し、これを Serverブロック内に組み込みます: {{hc|/etc/nginx/conf.d/letsencrypt.conf| <nowiki> location ^~ /.well-known { allow all; alias /var/lib/letsencrypt/.well-known/; default_type "text/plain"; try_files $uri =404; } </nowiki>}} サーバー構成の例: {{hc|/etc/nginx/servers-available/domain.conf|<nowiki> server { server_name domain.tld .. include conf.d/letsencrypt.conf; } </nowiki>}} ==== Apache ==== {{ic|/etc/httpd/conf/extra/httpd-acme.conf}} ファイルを作成してください: {{hc|/etc/httpd/conf/extra/httpd-acme.conf|<nowiki> Alias /.well-known/acme-challenge/ "/var/lib/letsencrypt/.well-known/acme-challenge/" <Directory "/var/lib/letsencrypt/"> AllowOverride None Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Require method GET POST OPTIONS </Directory> </nowiki>}} そして、{{ic|httpd.conf}} で上記ファイルをインクルードします: {{hc|/etc/httpd/conf/httpd.conf|<nowiki> Include conf/extra/httpd-acme.conf </nowiki>}} === 自動更新 === ==== systemd ==== [[systemd]] {{ic|certbot.service}} ファイルを作成します {{hc|1=/etc/systemd/system/certbot.service| 2=[Unit] Description=Let's Encrypt renewal [Service] Type=oneshot ExecStart=/usr/bin/certbot renew --quiet --agree-tos}} 証明書を更新するたびにウェブサーバーを再起動させると良いでしょう。{{ic|certbot.service}} ファイルに以下のどちらかの行を追加してください: * Apache: {{ic|1=ExecStartPost=/bin/systemctl reload httpd.service}} * nginx: {{ic|1=ExecStartPost=/bin/systemctl reload nginx.service}} {{Note|[[systemd/タイマー|タイマー]]を追加する前に、サービスが正しく動作すること、何も入力が要求されないことを確認してください。}} それから、タイマーを追加することで証明書を更新できます (更新の必要がない証明書は自動的にスキップされます)。 {{hc|1=/etc/systemd/system/certbot.timer| 2=[Unit] Description=Daily renewal of Let's Encrypt's certificates [Timer] OnCalendar=0/12:00:00 RandomizedDelaySec=1h Persistent=true [Install] WantedBy=timers.target}} {{ic|certbot.timer}} を[[起動]]・[[有効化]]してください。 ==== その他のサービス ==== Standalone プラグインを使用する場合は更新リクエストを実行する前にウェブサーバーを停止させて、更新が完了してからウェブサーバーを再起動するようにします。Certbot のフックを使ってください。 ===== nginx ===== {{hc|1=/etc/systemd/system/certbot.service| 2=[Unit] Description=Let's Encrypt renewal [Service] Type=oneshot ExecStart=/usr/bin/certbot renew --post-hook "/usr/bin/systemctl restart nginx.service" --agree-tos}} ===== Apache ===== {{hc|1=/etc/systemd/system/certbot.service| 2=[Unit] Description=Let's Encrypt renewal [Service] Type=oneshot ExecStart=/usr/bin/certbot renew --pre-hook "/usr/bin/systemctl stop httpd.service" --post-hook "/usr/bin/systemctl start httpd.service" --quiet --agree-tos}} == 参照 == * [https://certbot.eff.org/ EFF's Certbot documentation] * [https://letsencrypt.org/docs/client-options/ ACME クライアントの一覧]
このページで使用されているテンプレート:
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:META Box
(
ソースを閲覧
)
テンプレート:META Box Blue
(
ソースを閲覧
)
テンプレート:META Box Red
(
ソースを閲覧
)
テンプレート:Note
(
ソースを閲覧
)
テンプレート:Pkg
(
ソースを閲覧
)
テンプレート:TranslationStatus
(
ソースを閲覧
)
テンプレート:Warning
(
ソースを閲覧
)
Certbot
に戻る。
検索
検索
Certbotのソースを表示
話題を追加