使用Caddy 2的安装、配置gzip,websocket,redir,PHP,basicauth搭建一个简单的WEB网站。
Caddy V2版本改动较大,详见Upgrading to Caddy 2配置文件Caddyfile、JSON与Caddy v1不兼容。许多小伙伴们吐槽在开倒车,可视自己的需求决定是否升级到Caddy2,详情参考Caddy官网
https://caddyserver.com https://github.com/caddyserver/caddy 安装 Caddy下载安装
Debian, Ubuntu, Raspbian
echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" \ | tee -a /etc/apt/sources.list.d/caddy-fury.list apt update apt install caddy Fedora or RHEL/CentOS 8:
dnf install 'dnf-command(copr)' dnf copr enable @caddy/caddy dnf install caddy RHEL/CentOS 7:
yum install yum-plugin-copr yum copr enable @caddy/caddy yum install caddy 选择插件Download Caddy
比如Debian_x86_x64选择Linux amd64系统,再勾选插件(可多选)下载 后的文件名为caddy_linux_amd64_custom替换掉/usr/bin/caddy二进制可执行文件
mv caddy_linux_amd64_custom /usr/bin/caddy chmod +x /usr/bin/caddy 配置 systemd 开机自动启动服务 if you configure Caddy with a file.
...