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://*****;
        }
    }
相关推荐
mi20061 分钟前
银河麒麟v10 sp1更改data目录挂载
linux·运维
tft364012 分钟前
An attempt was made to access a socket in a way forbidden by its access
服务器·网络·tcp/ip
着迷不白1 小时前
华为堡垒机
linux·运维·服务器·centos
妮妮喔妮1 小时前
linux:查看某个文件下开启的进程占用的是哪个端口?
linux·运维·服务器
powerfulhell1 小时前
10.23作业
服务器
FJW0208142 小时前
【Linux】输入输出管理
linux·运维·服务器
遇见火星2 小时前
Aiops探索:基于Ansible的Dify版本运维智能体落地思路
运维·服务器·ansible
TG_yunshuguoji4 小时前
亚马逊云渠道商:如何通过配置自动替换构建故障自愈的云架构?
运维·服务器·架构·云计算·aws
期待着20134 小时前
StarRocks 集群安装部署文档
linux·服务器
2301_772093565 小时前
高并发webserver_interview
运维·服务器·数据库·后端·网络协议·mysql·wireshark