1 Star 0 Fork 0

yll1024335892 / shell_script

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
https_auto.sh 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
yll1024335892 提交于 2021-08-09 00:51 . https协议生产的注释
#!/bin/bash
# certbot renew --dry-run(查看续订状态) certbot renew(续订)
# 撤销证书certbot revoke --cert-path /etc/letsencrypt/archive/域名/cert1.pem
# 删除证书certbot delete
# 查看证书状态certbot certificates(域名,到期日,证书路径,私钥路径四条信息)
# 00 03 25 * * /usr/bin/certbot renew --quiet 进行定时(参考)
#-------------------nginx的配置-----------------
# server的节点中
# ssl_certificate /etc/letsencrypt/live/域名/fullchain.pem
# ssl_certificate_key /etc/letsencrypt/live/域名/privkey.pem
# 然后重启nginx(nginx -s reload)
# 开启443端口并配置listen 443 ssl;
#-------------------nginx的配置-----------------
EMAIL="1024335892@qq.com"
rpm -q epel-release &>/dev/null
if [ $? -ne 0 ]; then
yum install epel-release -y
fi
rpm -q certbot &>/dev/null
if [ $? -ne 0 ]; then
yum install certbot -y
fi
rpm -q openssl &>/dev/null
if [ $? -ne 0 ]; then
yum install openssl -y
fi
# WEB_ROOT(存放网站内容的绝对地址)的举例位置为/usr/local/nginx/html中
read -p "请输入站点根路径: " WEB_ROOT
if [ -z $WEB_ROOT ]; then
read -p "请输入站点根路径: " WEB_ROOT
fi
echo "站点跟目录为:$WEB_ROOT"
read -p "请输入不带协议的域名: " V_HOST
if [ -z $V_HOST ]; then
read -p "请输入不带协议的域名: " V_HOST
fi
echo "输入的域名为:$V_HOST"
certbot certonly --webroot -w $WEB_ROOT -d $V_HOST -m $EMAIL --agree-tos
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/1024335892/shell_script.git
git@gitee.com:1024335892/shell_script.git
1024335892
shell_script
shell_script
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891