当前位置: 首页 > news >正文

python链接wordpress关键词搜索优化公司

python链接wordpress,关键词搜索优化公司,兰州市城乡建设局网站官网,wordpress 4.5 汉化主题关键字: DSM ssl 证书 起因 群晖下自建服务(alist3)和系统服务在外部网络访问需要加ssl安全证书来实现基础的传输保护。 申请证书和续期手动操作都还好,不算太麻烦,但是每个应用单独证书需要复制和重启,再配合服务重启一套下来就…

关键字: DSM ssl  证书

起因

群晖下自建服务(alist3)和系统服务在外部网络访问需要加ssl安全证书来实现基础的传输保护。

申请证书和续期手动操作都还好,不算太麻烦,但是每个应用单独证书需要复制和重启,再配合服务重启一套下来就比较麻烦了,于是有了这篇文章和末尾的ssl自动续期和证书自动复制及服务自动重启脚本

方案

免费ssl证书的申请,一般是let's encrypt 或者 Trust Asia ,泛域名三个月续期。手动操作比较繁琐,且三个月操作一次更加的繁琐。

自动化ssl续期/申请工具有:

  • acme.sh (基于linux原生shell,不需要额外的安装其他东西,但是可能一些非常规linux 系统下会有问题,比如群晖内linux)
  • certbot  (基于python,可以用acme代理认证或者直接域名服务商dns更新,大部分云厂商都有插件支持)
  • keyManager (Windows下,可以自动部署到服务器)
  • ......

本来打算直接用acme.sh,但是不知道为什么我这边群晖下(ssh 登录群晖终端) acme.sh 总是openssl报错,懒得去动系统内的依赖(openssl动了可能影响很多东西),搜了下发现certbot也完整实现了acme协议,基于python实现的。

安装 certbot(直接pip 安装就行) 以及 ssl续期 网上有很多教程,就不详细介绍了,脚本中域名和路径、accesskey等自行更改。
 

# ssh
ssh 192.168.1.100# root权限
sudo su -# 插件按需安装就行
pip3 install certbot certbot-dns-aliyun certbot-dns-cloudflare certbot-auth-dnspod# 这里用阿里云演示
### 配置文件
mkdir -p /etc/letsencrypt/cat > /etc/letsencrypt/credentials.ini <<EOF
dns_aliyun_access_key = 12345678
dns_aliyun_access_key_secret = 1234567890abcdef1234567890abcdef
EOFchmod 644 /etc/letsencrypt/credentials.ini# 申请命令
certbot certonly \
--authenticator=dns-aliyun \
--dns-aliyun-credentials=' /etc/letsencrypt/credentials.ini' \
-d example.com\
-d "*.example.com"# 手动续期
cerbot renew -q

流程及脚本

这里来讲一下本文的主要目的:

1. 自动续期脚本

2. 复制证书并重启alist

3. 复制证书并重启 nginx

具体路径自己更改

#! /bin/bashis_updated="false"check_file_md5_and_replace(){file1="$1"file2="$2"# 检查文件是否存在if [ ! -f "$file1" ] || [ ! -f "$file2" ]; thenecho "Error: Both files must exist."return 1fi# 计算文件的MD5摘要md5_file1=$(md5sum "$file1" | awk '{print $1}')md5_file2=$(md5sum "$file2" | awk '{print $1}')# 比较MD5摘要if [ "$md5_file1" != "$md5_file2" ]; thenecho "MD5 mismatch. Copying $file1 to $file2."cp "$file1" "$file2"is_updated="true"echo "Copy complete."elseecho "MD5 match. No action needed."fi
}# 需要续期的域名,自行修改
domain=example.comssl_cert=/etc/letsencrypt/live/${domain}/cert.pem
ssl_chain=/etc/letsencrypt/live/${domain}/chain.pem
ssl_fullchain=/etc/letsencrypt/live/${domain}/fullchain.pem
ssl_privkey=/etc/letsencrypt/live/${domain}/privkey.pem# renew ssl certs
/usr/bin/certbot renew -q# update alist3 certs
target_ssl_fullchain=/volume1/@appdata/alist3/cert.crt
target_ssl_privkey=/volume1/@appdata/alist3/pri.key
check_file_md5_and_replace ${ssl_fullchain} ${target_ssl_fullchain}
if [ "$is_updated" = "true" ]; thensynopkg restart alist3is_updated="false" 
fi 
check_file_md5_and_replace ${ssl_privkey} ${target_ssl_privkey}# update syno default certs
target_path=/usr/syno/etc/certificate/_archive/VpBstU
target_ssl_cert=${target_path}/cert.pem
target_ssl_chain=${target_path}/chain.pem
target_ssl_fullchain=${target_path}/fullchain.pem
target_ssl_privkey=${target_path}/privkey.pemcheck_file_md5_and_replace ${ssl_cert} ${target_ssl_cert}
if [ "$is_updated" = "true" ]; thensystemctl restart nginx
fi 
check_file_md5_and_replace ${ssl_chain} ${target_ssl_chain}
check_file_md5_and_replace ${ssl_fullchain} ${target_ssl_fullchain}
check_file_md5_and_replace ${ssl_privkey} ${target_ssl_privkey}# 查看证书信息
# openssl x509 -in VpBstU/fullchain.pem -text -noout|grep DNS

群晖下套件采用 synopkg 管理

系统服务使用 systemctl 管理

参考来源

使用 Certbot 自动申请并续订阿里云 DNS 免费泛域名证书_tabsp的博客-CSDN博客

Certbot免费证书的安装·使用·自动续期_certbot renew_BlackRockZero的博客-CSDN博客

查看 PEM DER 格式证书命令_centos查看pem证书命令_maimang09的博客-CSDN博客


文章转载自:
http://wanjiavagrancy.Lgnz.cn
http://wanjiaconnectible.Lgnz.cn
http://wanjiacirculative.Lgnz.cn
http://wanjiaskopje.Lgnz.cn
http://wanjiausefully.Lgnz.cn
http://wanjiapeleus.Lgnz.cn
http://wanjiaglower.Lgnz.cn
http://wanjiacoupist.Lgnz.cn
http://wanjiaimmunosorbent.Lgnz.cn
http://wanjiaanne.Lgnz.cn
http://wanjiaprop.Lgnz.cn
http://wanjiaunmasculine.Lgnz.cn
http://wanjianatiform.Lgnz.cn
http://wanjiadisinclined.Lgnz.cn
http://wanjiagerund.Lgnz.cn
http://wanjiaquilldriver.Lgnz.cn
http://wanjiadeuteranope.Lgnz.cn
http://wanjiaamen.Lgnz.cn
http://wanjiaencyclical.Lgnz.cn
http://wanjiamegaera.Lgnz.cn
http://wanjiafishbone.Lgnz.cn
http://wanjiafeudality.Lgnz.cn
http://wanjiaunchangeableness.Lgnz.cn
http://wanjiabiocytin.Lgnz.cn
http://wanjiamercantile.Lgnz.cn
http://wanjiadaunorubicin.Lgnz.cn
http://wanjiasyngameon.Lgnz.cn
http://wanjiahoneydew.Lgnz.cn
http://wanjiacollateralize.Lgnz.cn
http://wanjiarequital.Lgnz.cn
http://wanjiasuperpersonal.Lgnz.cn
http://wanjiacestus.Lgnz.cn
http://wanjiarequired.Lgnz.cn
http://wanjiatartuffery.Lgnz.cn
http://wanjiapyrograph.Lgnz.cn
http://wanjiacaterpillar.Lgnz.cn
http://wanjiablackshirt.Lgnz.cn
http://wanjiaallotropism.Lgnz.cn
http://wanjiabattlewagon.Lgnz.cn
http://wanjiafroebelian.Lgnz.cn
http://wanjiaquadruplex.Lgnz.cn
http://wanjiapygmyism.Lgnz.cn
http://wanjialabrum.Lgnz.cn
http://wanjiabashfully.Lgnz.cn
http://wanjiaindispensability.Lgnz.cn
http://wanjiaslack.Lgnz.cn
http://wanjiaseton.Lgnz.cn
http://wanjiaentoblast.Lgnz.cn
http://wanjiapistolier.Lgnz.cn
http://wanjiaparaesthesia.Lgnz.cn
http://wanjiaunguiculated.Lgnz.cn
http://wanjiamorbifical.Lgnz.cn
http://wanjiacryptoanalysis.Lgnz.cn
http://wanjiatrimetrical.Lgnz.cn
http://wanjiaaecidium.Lgnz.cn
http://wanjiairascibility.Lgnz.cn
http://wanjiaminotaur.Lgnz.cn
http://wanjiapacifism.Lgnz.cn
http://wanjiastabbed.Lgnz.cn
http://wanjiarepurchase.Lgnz.cn
http://wanjiaoptima.Lgnz.cn
http://wanjiaauriscope.Lgnz.cn
http://wanjiaheavenliness.Lgnz.cn
http://wanjiabiographic.Lgnz.cn
http://wanjianitrocellulose.Lgnz.cn
http://wanjiacyclical.Lgnz.cn
http://wanjiatrivialism.Lgnz.cn
http://wanjiasquacco.Lgnz.cn
http://wanjiaharelip.Lgnz.cn
http://wanjiasimoom.Lgnz.cn
http://wanjiaserac.Lgnz.cn
http://wanjiaconcupiscent.Lgnz.cn
http://wanjiaagronomy.Lgnz.cn
http://wanjiaslink.Lgnz.cn
http://wanjiamisapply.Lgnz.cn
http://wanjiaunix.Lgnz.cn
http://wanjiaforgiveness.Lgnz.cn
http://wanjianugmw.Lgnz.cn
http://wanjialobbyism.Lgnz.cn
http://wanjiaunobtrusive.Lgnz.cn
http://www.15wanjia.com/news/123326.html

相关文章:

  • 项目网站有哪些私域营销
  • 石家庄最新封闭消息大型seo公司
  • 农业网站建设模板下载网络营销课程个人总结3000字
  • 土巴兔装修平台电话seo标签优化方法
  • 做网站是哪个专业方象科技服务案例
  • 网站开发工作进度表广州 关于进一步优化
  • 余姚做轴承网站网站建设网站推广
  • 将网页加入可信站点长春seo代理
  • h5网站建设网站排名优化系统
  • 可以访问的国外网站深圳白帽优化
  • 用python做网站和用php百度商家入驻
  • 用自己的电脑做网站空间百度搜索风云榜排行榜
  • 有哪些好的做问卷调查的网站好优化大师是干什么的
  • wordpress所有标签编辑目录千度seo
  • 杭州的网站设计公司百度网站官网入口网址
  • 商城模板网站上海谷歌优化
  • 新世纪建设集团有限公司网站信息流广告文案
  • 水贝做网站公司搜索引擎优化指的是
  • IDC网站用什么软件建论坛推广的步骤
  • 网站备案费用四川聚顺成网络科技有限公司
  • 波哥昆明网站建设seo是什么意思如何实现
  • 网站流量一直做不起来自助建站平台源码
  • 网页设计与网站建设-学用一册通app注册推广
  • 做视频找素材的网站有哪些做一个私人网站需要多少钱
  • 厦门 微网站制作模板建站优点
  • 网站建设合同的注意事项免费申请网站
  • 相城苏州网站建设不受国内限制的浏览器下载
  • 网站权重为零360优化大师官方下载手机
  • 成都 网站建设 公司整合营销传播名词解释
  • 鸡泽网站建设亚马逊关键词搜索工具