![](/img/trans.png)
[英]Error: Package: caddy-2.4.6-1.el9.x86_64 (copr:copr.fedorainfracloud.org:group_caddy:caddy) Requires: libc.so.6(GLIBC_2.34)(64bit)
[英]Cannot download caddy package on yum
2022 年 11 月 19 日編輯 - AH 的回答對我有用,可能就是你想要的。 我在下面給出的解決方案有效,但更復雜,需要 20 分鍾; AM 的回答需要 < 2 分鍾才能啟動並運行。
自 2022 年 10 月起,您無需了解任何 golang 即可構建 Caddy 2。
感謝這個答案: https ://stackoverflow.com/a/71622285/514608。 我在下面使用 caddyserver.org 上的幾個文檔提供了更多細節。 我在 Amazon Linux 2 Kernel 5.10 AMI 2.0.20220912.1 x86_64 HVM gp2 上運行了這個。
我給出的步驟使用“xcaddy”。 “go/bin/xcaddy build”命令需要很長時間,對我來說超過 20 分鍾。 幾天前,我在沒有 xcaddy 的情況下做了普通的舊版本。 今天,當我這樣做時,我收到了關於位不匹配的安全警告。 如文檔中所述,如果您不使用“xcaddy”,生成的 caddy 可執行文件的“version”子命令將不起作用。 有了 xcaddy 就可以了。
sudo yum install go -y
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
go/bin/xcaddy build
./caddy version
sudo cp caddy /usr/bin
# /usr/bin is the path used in example systemd unit files from
# caddy server.org, so if you don't use this path, you'd edit those
caddy version
# following: see https://caddyserver.com/docs/running
sudo groupadd --system caddy
sudo useradd --system \
--gid caddy \
--create-home \
--home-dir /var/lib/caddy \
--shell /usr/sbin/nologin \
--comment "Caddy web server" \
caddy
# not shown but required: you create a file named /etc/systemd/system/caddy.service
# as per docs/running link above, use one of the two unit files
# as a templat. After which, if you are using a Caddyfile:
sudo mkdir /etc/caddy
# And then create a Caddyfile in there at /etc/caddy/Caddyfile
sudo systemctl daemon-reload
sudo systemctl enable --now caddy
systemctl status -l caddy
對我來說,這個食譜適用於 Amazon Linux 2:
yum -y install yum-plugin-copr
yum -y copr enable @caddy/caddy epel-7-$(arch)
yum -y install caddy
請注意copr enable
的附加參數!
這是調試問題的更多背景信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.