34 lines
932 B
Markdown
34 lines
932 B
Markdown
# 手动配置https
|
|
|
|
## let's encypt certbot 手动方案
|
|
[官网](https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal&tab=standard)
|
|
|
|
前置条件:
|
|
1. 已经部署好nginx网站
|
|
2. 已经配置好dns
|
|
|
|
```bash
|
|
# 移除certbot
|
|
sudo apt-get remove certbot
|
|
# 安装certbot
|
|
sudo snap install --classic certbot
|
|
sudo ln -s /snap/bin/certbot /usr/bin/certbot
|
|
sudo certbot certonly --standalone
|
|
# 手动填写信息, 等待注册完成
|
|
# 此处会生成证书
|
|
```
|
|
(可选)通配符证书-route53 [说明文档](https://eff-certbot.readthedocs.io/en/latest/using.html#dns-plugins)
|
|
```sh
|
|
sudo snap set certbot trust-plugin-with-root=ok
|
|
sudo snap install certbot-dns-route53
|
|
sudo certbot certonly --dns-route53 -d example.com -d *.example.com -d *.example1.com -m user@example.com
|
|
```
|
|
|
|
### 如果是docker中, 则还需要将证书文件拷贝到容器中去
|
|
|
|
```bash
|
|
sudo cp -r /etc/letsencrypt/archive/*.huangguanpc.com /ssl
|
|
```
|
|
|
|
|