certbot 服务器证书配置

cerbot

1

bash 复制代码
sudo apt update
sudo apt install python3 python3-venv libaugeas0

2

bash 复制代码
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip

3

bash 复制代码
sudo /opt/certbot/bin/pip install certbot certbot-nginx

4

bash 复制代码
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot

5

bash 复制代码
sudo certbot certonly --nginx

6 nginxx config

bash 复制代码
 server {
        listen 80;	
        server_name *****.eu;
        location / {
            # Redirect all HTTP traffic to HTTPS
            return 301 https://$host$request_uri;
        }
    }
    server {
        listen 443 ssl;
        server_name *****eu;
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
		include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_certificate /etc/letsencrypt/live/digitalshield.ydns.eu/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/digitalshield.ydns.eu/privkey.pem;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
        location / {
       	    proxy_pass http://*****;
        }
    }
相关推荐
爱莉希雅&&&6 小时前
LVS+Keepalived+DNS+Web+NFS 高可用集群项目完整部署流程
运维·nginx·dns·lvs·keepalived·nfs·ipvsadm
小丑西瓜6666 小时前
CMake基础用法,cmake_minimum_required,project,add_executable
linux·服务器·c++·camke
晚风吹长发6 小时前
初步了解Linux中的命名管道及简单应用和简单日志
linux·运维·服务器·开发语言·数据结构·c++·算法
全栈测试笔记7 小时前
异步函数与异步生成器
linux·服务器·前端·数据库·python
weixin_462446237 小时前
Linux 下使用 xfreerdp3 远程连接 Windows(从安装到实战使用)
linux·运维·windows
爱丶狸7 小时前
Linux三剑客之sed
linux·运维·服务器
China_Yanhy7 小时前
区块链运维日记 · 第 1 日 :消失的 2000 笔提现 —— 致命的 Nonce 冲突
运维·区块链
趁着年轻吃点苦8 小时前
录用通知-自助系统的服务器部署指南
运维·服务器
仗剑恬雅人8 小时前
LINUX数据库高频常用命令
linux·运维·服务器·数据库·ssh·运维开发
CAAS_IFR_zp9 小时前
PICRUSt2-SC:16s功能注释的更新
服务器