default
menu home
图标库 注册 登录 favorite_border message help_outline
在线笔记 - 人性化网络收藏夹

Apache2网站安装开通https协议SSL证书

style分类标签: 全部 CSS html javascript php/other IT
by: fanshome  2023-05-21 07:24(UTC)

比较简单实用的一种做法是使用certbot,签发证书、安装、配置web服务器(apache/nginx等)、自动更新一条龙。详细介绍请访问cerbot官网:https://certbot.eff.org/

这里简单介绍主要步骤:(以Ubuntu linux server为例)

先安装snapd

sudo apt install snapd

确保安装的是最新版本内核

sudo snap install core; sudo snap refresh core;

使用snapd安装certbot

sudo snap install --classic certbot

sudo ln -s /snap/bin/certbot /usr/bin/certbot

最后,运行cerbot并自动配置apache运行https

sudo certbot --apache

其中,certbot会要求输入域名、email等信息,基本上照做就行。

成功后cerbot会返回如下信息

Successfully received certificate.

Certificate is saved at: /etc/letsencrypt/live/favinavi.com/fullchain.pem

Key is saved at: /etc/letsencrypt/live/favinavi.com/privkey.pem

This certificate expires on 2023-06-26.

These files will be updated when the certificate renews.

Certbot has set up a scheduled task to automatically renew this certificate in the background.

包含证书和密钥文件保存路径,证书过期日期等,并且告诉您可以让certbot在后台自动更新证书。

visibility 889


- 重度网络用户必备 在线笔记
adimg
logo 发表评论

captcha
请正确填写验证码
取 消