certbot自动在ubuntu16.04的nginx上部署let's encrypt免费ssl证书

简介: 版权声明:本文可能为博主原创文章,若标明出处可随便转载。 https://blog.
版权声明:本文可能为博主原创文章,若标明出处可随便转载。 https://blog.csdn.net/Jailman/article/details/79136172

终结CA收费时代,让互联网更安全


Install

On Ubuntu systems, the Certbot team maintains a PPA. Once you add it to your list of repositories all you'll need to do is apt-get the following packages.

$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-nginx 

Get Started

Certbot has an Nginx plugin, which is supported on many platforms, and certificate installation.

Due to a security issue, Let's Encrypt has stopped offering the mechanism that the Nginx plugin previously used to prove you control a domain. You can read more about this here.

We are planning on releasing a new version of Certbot in the next few days that works around this but if you have to obtain a certificate and cannot wait, you have a couple of options. If you're serving files for that domain out of a directory on that server, you can run the following command:

$ sudo certbot --authenticator webroot --installer nginx

If you're not serving files out of a directory on the server, you can temporarily stop your server while you obtain the certificate and restart it after Certbot has obtained the certificate. This would look like:

$ sudo certbot --authenticator standalone --installer nginx --pre-hook "nginx -s stop" --post-hook "nginx"

Running either of these commands will get a certificate for you and have Certbot edit your Nginx configuration automatically to serve it. If you're feeling more conservative and would like to make the changes to your Nginx configuration by hand, you can use the certonlysubcommand. To see instructions on how to use this subcommand, select "None of the above" in the first drop-down menu above.

To learn more about how to use Certbot read our documentation.

Automating renewal

The Certbot packages on your system come with a cron job that will renew your certificates automatically before they expire. Since Let's Encrypt certificates last for 90 days, it's highly advisable to take advantage of this feature. You can test automatic renewal for your certificates by running this command:

$ sudo certbot renew --dry-run

More detailed information and options about renewal can be found in the full documentation.


目录
相关文章
|
10天前
|
存储 算法 安全
ssl 证书名词解释--crt和pem
ssl 证书名词解释--crt和pem
22 0
|
11天前
|
安全 搜索推荐 数据建模
解决网站“不安全”、“不受信”、“排名下降”,你需要——「SSL证书」
SSL证书是网络安全的关键,用于加密和验证网站身份,保护用户数据安全,防止信息被窃取。它分为DV、OV、EV和IV四种类型,每种验证网站身份的程度不同。DV证书快速签发,OV和EV证书提供更高级别的身份验证,EV证书曾在浏览器地址栏显示绿色。目前,DV证书占据市场大部分份额。SSL证书还有单域、通配符和多域之分,有效期曾从多年逐渐缩短至90天,以增强安全性。部署SSL证书能提升用户信任,优化SEO排名,并符合网络安全法规要求。
解决网站“不安全”、“不受信”、“排名下降”,你需要——「SSL证书」
|
2月前
|
负载均衡 Ubuntu 应用服务中间件
|
2月前
|
前端开发 应用服务中间件 Linux
nginx解决springcloud前后端跨域问题,同时配置ssl
nginx解决springcloud前后端跨域问题,同时配置ssl
|
4月前
|
应用服务中间件 网络安全 nginx
nginx 常用命令 |升级到1.20.1版本 | 如何更换 Nginx SSL 证书
nginx 常用命令 |升级到1.20.1版本 | 如何更换 Nginx SSL 证书
152 0
|
2月前
|
运维 应用服务中间件 Shell
通过 saltstack 批量更新 SSL 证书
通过 saltstack 批量更新 SSL 证书
|
2月前
|
应用服务中间件 网络安全 nginx
解决nginx:[emerg]unknown directive ssl错误
解决nginx:[emerg]unknown directive ssl错误
|
2月前
|
Java 应用服务中间件 网络安全
Nginx配置静态页面+springboot应用+swagger+SSL的实现
Nginx配置静态页面+springboot应用+swagger+SSL的实现
|
2月前
|
存储 Linux 网络安全
如何在 Linux 中删除 SSL 证书和 SSH 密码?
如何在 Linux 中删除 SSL 证书和 SSH 密码?
79 1
如何在 Linux 中删除 SSL 证书和 SSH 密码?
|
2月前
|
Kubernetes 网络安全 容器
Cert Manager 申请 SSL 证书流程及相关概念 - 一
Cert Manager 申请 SSL 证书流程及相关概念 - 一