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://*****;
        }
    }
相关推荐
珹洺1 小时前
Linux操作系统从入门到实战(四)Linux基础指令(下)
linux·运维·服务器
极小狐1 小时前
极狐GitLab 的压缩和合并是什么?
运维·git·ssh·gitlab·github
唯独失去了从容3 小时前
WebRTC服务器Coturn服务器的管理平台功能
运维·服务器·webrtc
roman_日积跬步-终至千里5 小时前
【K8s基础】K8s下的Helm和Operator:包管理器与运维程序化
运维·容器·kubernetes
PassLink_7 小时前
[Kaggle]:使用Kaggle服务器训练YOLOv5模型 (白嫖服务器)
运维·服务器·yolo
朴拙数科7 小时前
MongoDB Atlas与MongoDB连接MCP服务器的区别解析
服务器·数据库·mongodb
极小狐8 小时前
极狐GitLab 合并请求依赖如何解决?
运维·git·ssh·gitlab·github
程序猿(雷霆之王)8 小时前
Linux——进程间通信
linux·运维·服务器
NoneCoder10 小时前
HTML 模板技术与服务端渲染
服务器·servlet·html
Cloud_Air75410 小时前
从零开始使用SSH链接目标主机(包括Github添加SSH验证,主机连接远程机SSH验证)
运维·ssh