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| * The Webroot method requires '''HTTP on port 80''' for Certbot to validate. ** For Certbot to validate using '''HTTPS on port 443''', the Nginx ('''--nginx''') or Apache ('''--apache''') plugin must be used instead of the Webroot ('''--webroot''') method. * The Server Name must match that of it's corresponding DNS. * Permissions may need to be altered on the host to allow read-access to {{ic|http://domain.tld/.well-known}}. }} webroot メソッドを使用する場合、certbotクライアントは検証のために使用される、{{ic|/path/to/domain.tld/html/.well-known/acme-challenge/}} の中でチャレンジ/レスポンス認証が行われます。 この使用方法は手動インストールよりも推奨されます。自動的に更新が行なわれ、証明書管理が容易になります。 {{Tip|1=The following initial [[Nginx#Server_blocks|nginx server]] configuration may be helpful to obtain a first-time certificate: {{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> }} }} ==== 証明書を取得する ==== {{Accuracy|detail lacking to successfully accomplish task being taught|section=accuracy_flag}} Request a certificate for {{ic|domain.tld}} using {{ic|/var /lib/letsencrypt/}} as public accessible path: # certbot certonly --email '''email@example.com''' --webroot -w '''/var/lib/letsencrypt/''' -d '''domain.tld''' To add a (sub)domain, include all registered domains used on the current setup: # certbot certonly --email '''email@example.com''' --webroot -w '''/var/lib/letsencrypt/''' -d '''domain.tld,sub.domain.tld''' To renew (all) the current certificate(s): # 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''/}} に作られるファイルの名前には末尾に数字が付加されます。作成されたファイル名かウェブサーバーの設定を書き換える必要があります。}} == 高度な設定 == === Webserver Configuration === Instead of using plugins for automatic configuration, it may be preferred to enable SSL for a server manually. {{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 ==== An example of the server {{ic|domain.tld}} using the signed SSL-certificate of Let's Encrypt: {{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> }} === マルチドメイン === 複数のドメインあるいはサブドメインを使用する場合、全てのドメインに対して webroot を指定する必要があります。別の webroot を指定しないと、既存の webroot が使われます。 {{ic|/.well-known/acme-challenge/}} への http リクエストを全て一つのフォルダ (例: {{ic|/var/lib/letsencrypt}}) にまとめることで、マルチドメインの管理がとても楽になります。nginx ならば、以下のようなファイルを作成: {{hc|/etc/nginx/letsencrypt.conf|<nowiki> location ^~ /.well-known/acme-challenge { alias /var/lib/letsencrypt/.well-known/acme-challenge; default_type "text/plain"; try_files $uri =404; } </nowiki>}} そして証明書を作成したいサイトの server ブロックの中に以下のように記述します: {{hc|/etc/nginx/servers/example.com.conf|<nowiki> server { ... include letsencrypt.conf; } </nowiki>}} Apache の場合、{{ic|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>}} letsencrypt クライアントのパスから設定したパスに書き込めるように、また、ウェブサーバーから読み込めるようにする必要があります。次のコマンドを実行してください: {{ic|# chgrp http /var/lib/letsencrypt && chmod g+s /var/lib/letsencrypt}}。 === 自動更新 === ==== 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 --pre-hook "/usr/bin/systemctl stop nginx.service" --post-hook "/usr/bin/systemctl start nginx.service" --quiet --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://letsencrypt.org/docs/client-options/ ACME クライアントの一覧]
このページで使用されているテンプレート:
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:Note
(
ソースを閲覧
)
テンプレート:Pkg
(
ソースを閲覧
)
テンプレート:TranslationStatus
(
ソースを閲覧
)
テンプレート:Warning
(
ソースを閲覧
)
Certbot
に戻る。
検索
検索
Certbotのソースを表示
話題を追加