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://*****;
        }
    }
相关推荐
Fortune_yangyang1 分钟前
Docker 入门指南:从 “容器小白” 到快速上手
运维·docker·容器
HIT_Weston44 分钟前
68、【Ubuntu】【Hugo】搭建私人博客:方案分析(二)
linux·运维·ubuntu
chenyuhao20241 小时前
Linux系统编程:线程概念与控制
linux·服务器·开发语言·c++·后端
cws2004012 小时前
HeidiSQL 使用操作说明书
运维·数据库·windows·mysql·heidisql
prettyxian2 小时前
【linux】进程概念(1)PCB、系统调用与 proc 目录全解析
linux·运维·服务器
YJlio2 小时前
Streams 学习笔记(12.2):看见 NTFS 隐藏的备用数据流(ADS)
服务器·笔记·学习
霜雪i2 小时前
Linux MD5
linux·服务器
乾元2 小时前
用 AI 做联动:当应用层出现问题,网络如何被“自动拉入决策回路”
运维·开发语言·网络·人工智能·ci/cd·自动化
youxiao_902 小时前
Docker 容器(一)
运维·docker·容器
小尧嵌入式2 小时前
Linux进程线程与进程间通信
linux·运维·服务器·c语言·开发语言·数据结构·microsoft