当前位置: 首页> 文旅> 美景 > 软件平台化_成都seo优化_企业如何进行网站推广_软文300字介绍商品

软件平台化_成都seo优化_企业如何进行网站推广_软文300字介绍商品

时间:2025/8/10 19:25:00来源:https://blog.csdn.net/lihuang319/article/details/144479351 浏览次数:0次
软件平台化_成都seo优化_企业如何进行网站推广_软文300字介绍商品

进入nginx docker,一般是Alpine Linux系统


1. 依次执行命令:

sudo docker-compose exec nginx bashapk updateapk add certbot apk add --no-cache python3 python3-dev build-baseapk add python3 py3-pippip3 install --upgrade pippip3 install certbot-dns-aliyun -i https://mirrors.aliyun.com/pypi/simple/ --default-timeout=100 --no-cache-dir

最后一步一直报错,把pip3版本改成21.3.1, python版本改为3.6成功了。

pip3 install --upgrade pip==21.3.1pip3 --version
pip 21.3.1 from /usr/lib/python3.6/site-packages/pip (python 3.6)


2.创建阿里云RAM 用户账号,赋予AliyunDNSFullAccess权限,阿里云登录 - 欢迎登录阿里云,安全稳定的云计算服务平台

sudo vi /etc/letsencrypt/aliyun.ini
在文件中添加以下内容:

certbot_dns_aliyun:dns_aliyun_access_key = your-access-key
certbot_dns_aliyun:dns_aliyun_access_key_secret = your-access-key-secret


3.生成证书

certbot certonly -a certbot-dns-aliyun:dns-aliyun --certbot-dns-aliyun:dns-aliyun-credentials /etc/letsencrypt/aliyun.ini  -d '*.xxx.com,xxx.com' --email xxx@163.com --config-dir /etc/nginx/ssl

--config-dir参数为证书存放路径,可以去掉,默认是/etc/letsencrypt/live/

vi /usr/local/bin/ssl_renew_and_reload.sh

在文件中添加以下内容:

#!/bin/shcertbot renew \-a certbot-dns-aliyun:dns-aliyun \--certbot-dns-aliyun:dns-aliyun-credentials /etc/letsencrypt/aliyun.ini \--email xxx@163.com \--config-dir /etc/nginx/ssl \--certbot-dns-aliyun:dns-aliyun-propagation-seconds 60 nginx -s reload

设置权限:

chmod +x /usr/local/bin/ssl_renew_and_reload.sh

查看证书:

certbot certificates

4.定时任务

crontab -e0 0 * * * /usr/local/bin/ssl_renew_and_reload.sh >> /var/log/letsencrypt/renew.log 2>&1


 

注意:
使用生成证书的命令是有接口限制的,因此不建议频繁调用,如果报错了先排查出问题再继续,可以在末尾加上--dry-run用于获取测试证书排查问题,没有报错后再去掉它获取正式证书

certbot certonly --webroot -w /home/wwwroot/xxx -d xxx.com --dry-run

sudo certbot renew --dry-run
            
查看生成的文件路径和参数:cat /etc/letsencrypt/renewal/域名.conf
运行:/usr/local/bin/ssl_renew_and_reload.sh
检查 /var/log/letsencrypt/letsencrypt.log 有没有错误


 

关键字:软件平台化_成都seo优化_企业如何进行网站推广_软文300字介绍商品

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: