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://*****;
        }
    }
相关推荐
Karoku0662 小时前
【CI/CD】CI/CD环境搭建流程和持续集成环境配置
运维·ci/cd·docker·容器·kubernetes·prometheus
勤奋的凯尔森同学5 小时前
webmin配置终端显示样式,模仿UbuntuDesktop终端
linux·运维·服务器·ubuntu·webmin
丁卯4045 小时前
Go语言中使用viper绑定结构体和yaml文件信息时,标签的使用
服务器·后端·golang
chengooooooo5 小时前
苍穹外卖day8 地址上传 用户下单 订单支付
java·服务器·数据库
人间打气筒(Ada)7 小时前
MySQL主从架构
服务器·数据库·mysql
落笔画忧愁e8 小时前
FastGPT快速将消息发送至飞书
服务器·数据库·飞书
小冷爱学习!8 小时前
华为动态路由-OSPF-完全末梢区域
服务器·网络·华为
技术小齐9 小时前
网络运维学习笔记 016网工初级(HCIA-Datacom与CCNA-EI)PPP点对点协议和PPPoE以太网上的点对点协议(此处只讲华为)
运维·网络·学习
ITPUB-微风9 小时前
Service Mesh在爱奇艺的落地实践:架构、运维与扩展
运维·架构·service_mesh
落幕9 小时前
C语言-进程
linux·运维·服务器