ACME 配置说明
【摘要】 ACME 配置的方法纪要
SSL - ACME 配置

安装git
如果服务器上没有git,先安装一下
dnf install git
安装acme.sh
git clone --depth 1 https://gh-proxy.com/https://github.com/acmesh-official/acme.sh.git cd acme.sh ./acme.sh --install -m 你的邮箱@xinghansoft.com
将邮箱地址更换一下
然后重新连接ssh来让安装生效。
配置nginx
修改nginx.conf,注意把xxx.com替换为实际域名:
server {
listen 80;
server_name xxx.com;
charset utf-8;
# 除.well-known开头的全部跳转https(.well-known用于证书申请/续期验证)
rewrite ^(?!/\.well-known)(.*) https://$server_name$1 permanent;
location /.well-known/ {
alias html/acme_challenge/.well-known/;
index index.html;
}
}
在nginx目录下,创建文件夹并重启nginx:
mkdir /alidata/service/nginx-1.22.1/html/acme_challenge /alidata/service/nginx-1.22.1/sbin/nginx -s reload
申请证书并安装
注意把xxx.com替换为实际域名,然后(**关闭xShell,重启进入**),否则会报告找不到命令。
acme.sh --issue -d xxx.com -w /alidata/service/nginx-1.22.1/html/acme_challenge acme.sh --installcert -d xxx.com \ --fullchain-file /alidata/service/ssl/xxx.com.crt \ --key-file /alidata/service/ssl/xxx.com.key \ --reloadcmd "/alidata/service/nginx-1.22.1/sbin/nginx -s reload"
配置微信企业通知(服务器第一次配置时做一遍即可)
export WEIXIN_WORK_WEBHOOK='https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=*********' export WEIXIN_WORK_KEYWORD=ACME acme.sh --set-notify --notify-hook weixin_work
配置企业微信的通知,需要获取webhook,如下所示。

【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)