将 www 目录放到 home 目录
安装 php sqlite

apt install sqlite php7.0-fpm php7.0-sqlite php7.0-xml php7.0-gd 

安装 Caddy

curl https://getcaddy.com | bash -s personal

创建 Caddy 配置文件

mkdir /etc/caddy
vi /etc/caddy/Caddyfile

编辑内容

hantu.win {
    tls [email protected]
    root /home/www
    header / Strict-Transport-Security "max-age=31536000;"
    gzip
    log /home/hantu_win.log
    fastcgi / /run/php/php7.0-fpm.sock php
}

www.hantu.win {
    redir https://hantu.win{uri}
}
blog.hantu.win {
    redir https://hantu.win{uri}
}

创建 Caddy 服务

vi /etc/systemd/system/caddy.service

编辑内容

[Unit]
Description=caddy

[Service]
ExecStart=/usr/local/bin/caddy -conf /etc/caddy/Caddyfile
Restart=always
  
[Install]
WantedBy=multi-user.target

加入自启动

systemctl enable caddy
systemctl start caddy

标签: none

添加新评论