Rat's

Caddy Web Server一键管理(开始/停止/安装/更新/卸载)脚本
说明:Caddy是一个极简而强大的HTTP服务器,支持HTTP/2静态网页服务器,安装也快,之前也发过逗比的一个C...
扫描右侧二维码阅读全文
15
2017/11

Caddy Web Server一键管理(开始/停止/安装/更新/卸载)脚本

说明:Caddy是一个极简而强大的HTTP服务器,支持HTTP/2静态网页服务器,安装也快,之前也发过逗比的一个Caddy脚本,参考:一个极简的HTTP Server: Caddy一键安装脚本,不过该脚本有点简洁,只提供安装+运行功能,现在再发个功能比较全的Caddy脚本,该脚本是爱学习的博主无意间在国外技术网站看到的,而国内很难找到这么齐全的,所以就分享给大家,且该脚本支持开始、停止、安装、更新、卸载等功能。

安装

Github地址:https://github.com/sayem314/Caddy-Web-Server-Installer

系统要求:Ubuntu 14.x15.x16.xDebian 7.x8.x9.xCentOS 6.87.2

运行以下命令:

wget https://git.io/vra5C -O - -o /dev/null|bash

然后使用下列命令进行操作:

caddy start  #开启Caddy Web Server
caddy stop  #停止Caddy Web Server
caddy reload  #重载Caddy Web Server
caddy restart  #重启Caddy Web Server
caddy status  #查看Caddy Web Server状态
caddy install  #安装Caddy Web Server
caddy edit  #编辑配置文件Caddyfile
caddy service  #使Caddy Web Server成为一项服务(upstart/systemd)
caddy update  #升级Caddy Web Server
caddy delete  #卸载Caddy and data
caddy about  #关于Caddy Web Server
caddy version  #检测脚本/Caddy/PHP5-fpm版本信息

安装插件命令:

caddy install http.cache,http.filemanager,http.ipfilter,http.ratelimit

安装caddy的时候会要求你输入域名,邮箱(帮你自动签发ssl),然后使用命令启动caddy即可!

虚拟主机文件夹:/var/caddywww
配置文件夹:/etc/Caddyfile

更多插件参考:https://caddyserver.com/download

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。
最后修改:2017 年 11 月 18 日 03 : 35 PM

发表评论 取消回复

5 条评论

  1. haha

    如何安装ssl?

    1. Rat's
      @haha

      编辑配置文件/etc/Caddyfile,然后在配置文件里面加一行代码tls admin.xx.com,后面为邮箱,具体参考:https://www.moerats.com/archives/422/

  2. @@

    無法啟動caddy 日誌顯示:Your sites will be served over HTTPS automatically using Let's Encrypt.
    By continuing, you agree to the Let's Encrypt Subscriber Agreement at:
    https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
    Do you agree to the terms? (y/n): 2019/02/22 07:41:35 user must agree to CA terms

    但無法運行caddy -agree

  3. 叶子

    这个微博怎么注册?

    1. Rat's
      @叶子

      什么微博?