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://*****;
        }
    }
相关推荐
DARLING Zero two♡12 分钟前
【Linux操作系统】简学深悟启示录:Linux权限
linux·运维·服务器
hxdcxy2 小时前
中间件部署
运维·服务器
李少兄5 小时前
CentOS系统下前后端项目部署攻略
linux·运维·centos
Two_brushes.7 小时前
【Linux】线程机制深度实践:创建、等待、互斥与同步
linux·运维·服务器·多线程
设计师小聂!9 小时前
Linux系统中部署Redis详解
linux·运维·数据库·redis
努力做小白11 小时前
Linux驱动11 --- buildroot&杂项驱动开发方法
linux·运维·驱动开发·单片机·嵌入式硬件
Sally璐璐11 小时前
Memcache核心技术解析与实战应用
运维·wpf·memcached
哈哈浩丶11 小时前
Linux驱动开发1:设备驱动模块加载与卸载
linux·运维·驱动开发
wanhengidc12 小时前
UDP服务器的优缺点都包含哪些?
服务器·网络协议·udp
诗人不说梦^14 小时前
[BUUCTF 2018]Online Tool
linux·运维·服务器