コンテンツにスキップ

「Acme.sh」の版間の差分

提供: ArchWiki
削除された内容 追加された内容
インストール: 文章を変更
12行目: 12行目:
== 使用方法 ==
== 使用方法 ==


The package does not provide man pages, but a [https://github.com/acmesh-official/acme.sh/wiki/ wiki] for usage. Executing {{ic|acme.sh --help}} outputs a long list of commands and parameters.
このパッケージは man ページを提供しませんが、使い方は [https://github.com/acmesh-official/acme.sh/wiki/ wiki] に書いてあります。{{ic|acme.sh --help}} を実行すると、コマンドとパラメータの長いリストが出力されます。


基本的には 3 つのステップがあります。
There are three basic steps involved:


# 証明書の発行を依頼する。
# Requesting a certificate to be issued.
# 発行された証明書をインストールし、使えるようにする。
# Installing the issued certificate, to make it useful.
# 証明書を長期的に維持する。
# Maintaining the certificate over time.


以下の例で説明します。
as covered with below examples.


=== Issuing a new cert ===
=== 新しい証明書を発行 ===


{{ic|-d}} オプションで任意のドメインを指定することができます。
You can specify any domain with the {{ic|-d}} option.


{{Tip|You might want to [https://community.letsencrypt.org/t/the-acme-sh-will-change-default-ca-to-zerossl-on-august-1st-2021/144052 specify] LetsEncrypt as your default CA, as acme.sh uses ZeroSSL as its default CA effective from August 1st, 2021.}}
{{Tip|acme.sh は2021年8月1日から ZeroSSL をデフォルト CA として使用しているため、LetsEncrypt をデフォルト CA として[https://community.letsencrypt.org/t/the-acme-sh-will-change-default-ca-to-zerossl-on-august-1st-2021/144052 指定]するとよいでしょう。}}


{{ic|acme.sh}} スクリプトは、さまざまなモードをサポートしています。指定するモードとオプションの例は次のとおりです。
The {{ic|acme.sh}} script support different modes. Examples for modes and options to be specified are:


* Webroot mode:
* Webroot モード:


:{{ic|$ acme.sh --issue -d example.com -d www.example.com -d cp.example.com -d '*.example.com' -w /home/wwwroot/example.com}}
:{{ic|$ acme.sh --issue -d example.com -d www.example.com -d cp.example.com -d '*.example.com' -w /home/wwwroot/example.com}}


* スタンドアロンモード。ウェブサーバーが動作していない場合は {{ic|--standalone}} をつけてスタンドアロンモードにします:
* Standalone mode, by adding {{ic|--standalone}} if no web server is running (requires {{Pkg|socat}} installed):


:{{ic|$ acme.sh --issue --standalone -d example.com -d www.example.com -d cp.example.com}}
:{{ic|$ acme.sh --issue --standalone -d example.com -d www.example.com -d cp.example.com}}


* Nginx mode:
* Nginx モード:


:{{ic|$ acme.sh --issue --nginx -d example.com -d www.example.com -d cp.example.com}}
:{{ic|$ acme.sh --issue --nginx -d example.com -d www.example.com -d cp.example.com}}


* DNS mode (see [https://github.com/acmesh-official/acme.sh/wiki/dnsapi official wiki] for further information):
* DNS モード (詳しくは [https://github.com/acmesh-official/acme.sh/wiki/dnsapi official wiki] を参照してください):


:{{ic|$ acme.sh --issue -d example.com -d '*.example.com' --dns dns_he}}
:{{ic|$ acme.sh --issue -d example.com -d '*.example.com' --dns dns_he}}


The project's wiki lists [https://github.com/acmesh-official/acme.sh/wiki/How-to-issue-a-cert more examples].
プロジェクトの wiki には lists [https://github.com/acmesh-official/acme.sh/wiki/How-to-issue-a-cert さらに多くの例]が掲載されています。


=== Install the cert to Apache/Nginx etc ===
=== Install the cert to Apache/Nginx etc ===

2022年7月6日 (水) 10:57時点における版

acme.sh シェルスクリプトだけで書かれた ACME クライアントです。ACME プロトコルを完全に実装しており、例えば IPv6 やワイルドカード証明書などをサポートしています。

インストール

acme.sh パッケージをインストールします。スタンドアロンモードを使用する場合は、socat をインストールします。

使用方法

このパッケージは man ページを提供しませんが、使い方は wiki に書いてあります。acme.sh --help を実行すると、コマンドとパラメータの長いリストが出力されます。

基本的には 3 つのステップがあります。

  1. 証明書の発行を依頼する。
  2. 発行された証明書をインストールし、使えるようにする。
  3. 証明書を長期的に維持する。

以下の例で説明します。

新しい証明書を発行

-d オプションで任意のドメインを指定することができます。
ヒント acme.sh は2021年8月1日から ZeroSSL をデフォルト CA として使用しているため、LetsEncrypt をデフォルト CA として指定するとよいでしょう。

acme.sh スクリプトは、さまざまなモードをサポートしています。指定するモードとオプションの例は次のとおりです。

  • Webroot モード:
$ acme.sh --issue -d example.com -d www.example.com -d cp.example.com -d '*.example.com' -w /home/wwwroot/example.com
  • スタンドアロンモード。ウェブサーバーが動作していない場合は --standalone をつけてスタンドアロンモードにします:
$ acme.sh --issue --standalone -d example.com -d www.example.com -d cp.example.com
  • Nginx モード:
$ acme.sh --issue --nginx -d example.com -d www.example.com -d cp.example.com
  • DNS モード (詳しくは official wiki を参照してください):
$ acme.sh --issue -d example.com -d '*.example.com' --dns dns_he

プロジェクトの wiki には lists さらに多くの例が掲載されています。

Install the cert to Apache/Nginx etc

Nginx:

$ acme.sh --install-cert -d example.com --key-file '/path/to/keyfile/in/nginx/example.key' --fullchain-file '/path/to/fullchain/nginx/example.cer' --reloadcmd "systemctl force-reload nginx"

Apache:

$ acme.sh --install-cert -d example.com --cert-file '/path/to/certfile/in/apache/example.cer' --key-file '/path/to/keyfile/in/apache/example.key' --fullchain-file '/path/to/fullchain/certfile/apache/example.fullchain.cer' --reloadcmd "systemctl force-reload nginx apache2"

Maintaining a cert

The certs will be renewed every 60 days. To run acme.sh regularly, a systemd timer may be set up.

参照

  • Project homepage and wiki for its documentation.
  • acme-tiny offers several related utilities, as well as additional general ACME documentation.
  • lacme is a small ACME client written with process isolation and minimal privileges in mind.