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://*****;
        }
    }
相关推荐
北漂老男孩10 分钟前
在 Linux 上安装 MATLAB:完整指南与疑难解决方案
linux·运维·matlab
Why not try?!17 分钟前
Centos7 中 Docker运行配置Apache
运维·docker·容器
杰克逊的日记25 分钟前
Flink运维要点
大数据·运维·flink
hnlucky39 分钟前
如何彻底清空docker里面不使用的容器?
运维·docker·容器
像风一样的男人@1 小时前
Linux --systemctl损坏
linux·运维·服务器
南棱笑笑生1 小时前
20250515测试飞凌的OK3588-C的核心板在Linux R4下适配以太网RTL8211F-CG时跑iperf3的极速
linux·服务器·网络
南方以南_1 小时前
【云实验】搭建个人网盘实验
linux·运维·服务器
humors2211 小时前
Windows运维工具批处理版
运维·windows·计算机·电脑·笔记本·维护·台式机
xbd_zc2 小时前
【Linux Nano Vim快捷键大全】
linux·运维·vim
Mapleay2 小时前
ubuntu 更新华为源
运维·服务器·ubuntu