虚拟主机网站ssl_免费证书
华为云ECS 网站配置网站ssl,SSL 证书是 HTTPS 的基础。网站ssl 时先确认证书类型(免费 Let's Encrypt / 付费 DV/OV/EV)、证书域名是否包含所有绑定域名、证书是否在有效期内。证书部署后清缓存测试。
证书续签:Let's Encrypt 证书90天有效期,宝塔/虚拟主机自动续签,也可手动 certbot renew。付费证书1年有效期,到期前重新申请部署。证书过期后浏览器报"您的连接不是私密连接",用户不敢访问。到期前15天开始续签流程。
参考(Let's Encrypt证书申请): ``` # certbot申请(Nginx) certbot --nginx -d 域名 -d www.域名
# 续签测试 certbot renew --dry-run
# 手动续签 certbot renew
# 查看证书 certbot certificates
# 证书位置(Nginx) # /etc/letsencrypt/live/域名/fullchain.pem # /etc/letsencrypt/live/域名/privkey.pem
# 宝塔面板:网站 → SSL → Let's Encrypt → 勾选域名 → 申请 # 自动续签,无需手动操作
# 混合内容检查(数据库批量替换) # WordPress UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://旧域名', 'https://域名'); UPDATE wp_options SET option_value = REPLACE(option_value, 'http://旧域名', 'https://域名') WHERE option_name IN ('siteurl','home'); ```
私钥密码保护是网站ssl 的常见问题。证书过期续签;证书域名不匹配重新申请包含所有域名的证书;证书链不完整用完整链证书(含中间证书);私钥不匹配用对应私钥;混合内容替换为 https;未强制 HTTPS 配置301;HTTPS 端口未开放行443;CDN 证书未同步在 CDN 后台部署。
证书格式转换:pem/crt/key 是 Apache/Nginx 格式,pfx/p12是 IIS 格式。用 openssl 转换:pfx 转 pem:openssl pkcs12 -in cert.pfx -out cert.pem -nodes;pem 转 pfx:openssl pkcs12 -export -out cert.pfx -inkey key.pem -in cert.pem。转换时注意私钥保护。

更新时间:2026-08-26 23:19:01
上一篇:虚拟主机FTP密码修改记录能查吗?_操作日志与安全审计方法_配置设置教程