博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用Let's Encrypt、Certbot为自己的网站加密
阅读量:7262 次
发布时间:2019-06-29

本文共 1211 字,大约阅读时间需要 4 分钟。

hot3.png

  • 打开网站https://certbot.eff.org/
  • 选择服务器系统和软件环境
  • 以nginx+ubuntu为例:
# 1. 安装需要软件$ 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 # 2. 如果你已经安装有nginx,请关闭$ ps -ef | grep nginx$ root     21365     1  0 19:09 ?        00:00:00 nginx: master process nginx -c /etc/nginx/nginx.conf$ www-data 21380 21365  0 19:09 ?        00:00:00 nginx: worker process$ root     21443 18893  0 19:11 pts/1    00:00:00 grep --color=auto nginx$ kill -9 21365$ kill -9 21380# 3. 加密开始前还要确保443端口开放,并且前往步骤1中certbot自动安装的nginx中配置要加密的域名站点,默认安装在/etc/nginx目录,增加站点配置:server {  #开启80和443端口  listen 80;  listen [::]:80;  listen 443 ssl;  listen [::]:443 ssl;  root /var/www/html;  index index.html index.htm;  server_name baidu.com; #你的域名  location / {          try_files $uri $uri/ =404;  }}
  • 开始加密
    $ sudo certbot --nginx

     

  • 加密过程截图
  • 查看生成的证书
  • 关闭certbot自动安装的nginx
  • 查看certbot自动生成的证书配置
  • 将生成的证书配置拷贝到你的nginx对应域名配置中, 并重启nginx即可
  • 享受你的https吧!!
  • 更新证书时间
    $ sudo certbot renew --dry-run

     

  • 删除证书
    $ certbot delete --cert-name yourdomain

     


博主自己作品推荐:

西谷盒子:自带公网IP、即插即用、全端口开放、花生壳替代品
https://cigobox.taobao.com

转载于:https://my.oschina.net/SundyCigoOS/blog/1920433

你可能感兴趣的文章
《嵌入式系统数字视频处理权威指南》——第2章 视频处理介绍2.1数字视频:像素和分辨率...
查看>>
“九头虫”病毒技术分析报告
查看>>
iOS 缓存沙盒与文件操作 Swift
查看>>
Java代码优化,都有哪些常用方法?
查看>>
四年磨一剑,他将广告玩出新花样
查看>>
巨头专属?汇新杯助力中小企业拥抱人工智能_创成汇
查看>>
Spring Cloud-Honghu Cloud分布式微服务云系统(一)
查看>>
程序员如何让自己 Be Cloud Native - 配置篇
查看>>
在idea中如何打Jar包
查看>>
基于lvs-nat方式实现负载均衡
查看>>
C#并行编程之《停止或中断 Parallel.For 循环》
查看>>
linux实用技巧:使用快照制作虚拟机
查看>>
asp.net core web页面验证
查看>>
yum小技巧
查看>>
rhel7.5调整lvm分区配置挂载无法启动解决方法记录
查看>>
PHP_PDO数据库-基本操作总结_无需整理
查看>>
Windows Server 2012正式版RDS系列④
查看>>
在Linux中让echo命令显示带颜色的字。
查看>>
grep用法
查看>>
LVM
查看>>