Centos8安装部署Caddy2以及typecho/wordpress伪静态

Centos8(Caddy2)

yum -y -q install epel-release
yum -y copr enable @caddy/caddy
yum -y -q install caddy


/etc/caddy/Caddyfile的typecho配置例子

DOMAIN='blog.domian'
cat>/etc/caddy/Caddyfile<<EOF
${DOMAIN}, www.${DOMAIN}
{
   tls admin@${DOMAIN}
   root * /home/${DOMAIN}/
   encode gzip
   file_server
   php_fastcgi unix//dev/shm/php-fpm.sock
   handle_path / {   try_files {path} {path}/index.php?{query} index.php?{query}  }
}
EOF

“域名.后缀”  替换成自己的域名

/dev/shm/php-fpm.sock换成自己的php-fpm路径

多个域名用逗号和空格隔开, 可以绑定多个域名.

php自己安装配置, Caddyfile配置已经验证可用.

添加新评论 »