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://*****;
        }
    }
相关推荐
likfishdn17 分钟前
Linux的文件与目录管理
linux·运维·服务器
渲染101专业云渲染19 分钟前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
chian-ocean37 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=39 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
橘子味的茶二1 小时前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
北京耐用通信2 小时前
航空装配自动化神器Ethercat转profient网关搭配机器人精准控制
运维·机器人·自动化
吃汤圆的抹香鲸2 小时前
Rider 安装包 绿色版 Win/Mac/Linux 适合.NET和游戏开发者使用 2025全栈开发终极指南:从零配置到企业级实战
linux·运维·windows·sql·游戏·macos·.net