「Caddy」の版間の差分
Kusanaginoturugi (トーク | 投稿記録) (→インストール: 和訳) |
Kusanaginoturugi (トーク | 投稿記録) (→使用方法: == Troubleshooting == を追加) |
||
(同じ利用者による、間の2版が非表示) | |||
1行目: | 1行目: | ||
[[Category:ウェブサーバー]] |
[[Category:ウェブサーバー]] |
||
[[en:Caddy]] |
[[en:Caddy]] |
||
+ | [[zh-hans:Caddy]] |
||
[https://caddyserver.com/ Caddy] は自動的に HTTPS を使用する HTTP/2 対応のウェブサーバーです。 |
[https://caddyserver.com/ Caddy] は自動的に HTTPS を使用する HTTP/2 対応のウェブサーバーです。 |
||
6行目: | 7行目: | ||
{{Pkg|caddy}} パッケージを[[インストール]]してください。 |
{{Pkg|caddy}} パッケージを[[インストール]]してください。 |
||
+ | |||
+ | == Plugins == |
||
+ | |||
+ | If you need more than the base version of caddy, you can use {{AUR|xcaddy-bin}} to customize your caddy server build. This is useful if you need the additional plugins for DNS challenge etc. |
||
+ | Alternatively, if a pre-built package, with the plugins you require, is already available you may choose to install those from [https://aur.archlinux.org/packages/?O=0&K=caddy AUR], for eg. {{AUR|caddy-cloudflare}} |
||
+ | |||
+ | For a custom caddy server build you can use xcaddy to build caddy with the necessary plugin modules: |
||
+ | |||
+ | $ xcaddy build [<caddy_version>] |
||
+ | [--output <file>] |
||
+ | [--with <module[@version][=replacement]>...] |
||
+ | |||
+ | For more information, see the [https://github.com/caddyserver/xcaddy xcaddy repository]. |
||
== 設定 == |
== 設定 == |
||
26行目: | 40行目: | ||
$ caddy -conf="../path/to/Caddyfile" |
$ caddy -conf="../path/to/Caddyfile" |
||
+ | |||
+ | == Troubleshooting == |
||
+ | |||
+ | === Certificate error === |
||
+ | |||
+ | If you are facing any issues related to SSL certificates (especially on non-public domains), it is probably because the running caddy instance does not have permission to add the certificate to the system's trust store. This seems to be the case when the systemd unit (caddy.service) is used to autostart caddy. |
||
+ | |||
+ | To fix this, run the following as root. You only have to run this once in a very long time (lifetime of the root certificate). |
||
+ | |||
+ | # XDG_DATA_HOME=/var/lib caddy trust |
||
== 参照 == |
== 参照 == |
2021年12月9日 (木) 14:02時点における最新版
Caddy は自動的に HTTPS を使用する HTTP/2 対応のウェブサーバーです。
インストール
Plugins
If you need more than the base version of caddy, you can use xcaddy-binAUR to customize your caddy server build. This is useful if you need the additional plugins for DNS challenge etc. Alternatively, if a pre-built package, with the plugins you require, is already available you may choose to install those from AUR, for eg. caddy-cloudflareAUR
For a custom caddy server build you can use xcaddy to build caddy with the necessary plugin modules:
$ xcaddy build [<caddy_version>] [--output <file>] [--with <module[@version][=replacement]>...]
For more information, see the xcaddy repository.
設定
Caddy は Caddyfile
という名前のプレーンテキストファイルを使って設定します。Caddyfile
にはまずサイトのアドレスを記述して、それからディレクティブをいくつか書きます。
gzip 圧縮を使用し ../access.log
にログを出力して localhost:2020
からアクセスできるサイトを記述した Caddyfile
の例:
localhost:2020 gzip log ../access.log
使用方法
Caddy はページがあるディレクトリから通常ユーザーで実行できます。同一ディレクトリに Caddyfile
が存在する必要があります:
$ caddy
もしくは Caddyfile
を指定して実行することもできます:
$ caddy -conf="../path/to/Caddyfile"
Troubleshooting
Certificate error
If you are facing any issues related to SSL certificates (especially on non-public domains), it is probably because the running caddy instance does not have permission to add the certificate to the system's trust store. This seems to be the case when the systemd unit (caddy.service) is used to autostart caddy.
To fix this, run the following as root. You only have to run this once in a very long time (lifetime of the root certificate).
# XDG_DATA_HOME=/var/lib caddy trust