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://*****;
        }
    }
相关推荐
开航母的李大3 分钟前
软件系统运维常见问题
运维·服务器·系统架构·运维开发
华强笔记1 小时前
Linux内存管理系统性总结
linux·运维·网络
拾心212 小时前
【运维进阶】Ansible 角色管理
运维·ansible
phoenix09812 小时前
ansible部署lnmp-allinone
linux·运维·ansible
phoenix09814 小时前
Linux入门DAY27
linux·运维·服务器
xw55 小时前
免费的个人网站托管-PinMe篇
服务器·前端
egoist20237 小时前
【Linux仓库】进程创建与进程终止【进程·柒】
linux·运维·服务器·进程创建·写时拷贝·进程终止
大锦终7 小时前
【Linux】文件系统
linux·服务器·c++
Kyln.Wu7 小时前
【python实用小脚本-190】Python一键删除PDF任意页:输入页码秒出干净文件——再也不用在线裁剪排队
服务器·python·pdf
枫叶丹48 小时前
【Qt开发】常用控件(五)
服务器·前端·qt