极简部署linux免费ssl证书Let‘s Encrypt,自动续签,nginx/apache都可以,域名指向服务器即可,无需项目

1、拉取最新的代码

powershell 复制代码
git clone  https://gitee.com/neilpang/acme.sh.git

2、进入目录

powershell 复制代码
cd  acme.sh

3、安装

powershell 复制代码
./acme.sh  --install  -m  xxxx@qq.com 

xxxx@qq.com 切换自己邮箱

nginx 版本

4、 下载ssl证书

powershell 复制代码
./acme.sh  --issue  -d admin-beta.xxx.com  --nginx /www/server/nginx/conf/nginx.conf

admin-beta.xxx.com 替换为自己的域名, /www/server/nginx/conf/nginx.conf 替换为 本地的nginx配置文件的路径

5、安装ssl证书

nginx 复制代码
 ssl_certificate    /www/server/panel/vhost/cert/admin-beta.xxx.com/fullchain.pem;
 ssl_certificate_key    /www/server/panel/vhost/cert/admin-beta.xxx.com/privkey.pem;
powershell 复制代码
./acme.sh --install-cert -d admin-beta.xxx.com --key-file /www/server/panel/vhost/cert/admin-beta.xxx.com/privkey.pem --fullchain-file /www/server/panel/vhost/cert/admin-beta.xxx.com/fullchain.pem --reloadcmd "service nginx reload" 

将 service nginx reload 替换 自己nginx的重启命令

apache 版本

4、 下载ssl证书

powershell 复制代码
./acme.sh  --issue  -d admin-beta.xxx.com  --apache 

报错 可以设置

powershell 复制代码
ln -s /usr/local/apache/bin/apachectl /usr/bin/apachectl

5、安装ssl证书

apache 复制代码
SSLCertificateFile /etc/ssl/admin-beta.xxx.com/admin-beta.xxx.com.crt
SSLCertificateKeyFile /etc/ssl/admin-beta.xxx.com/admin-beta.xxx.com.key
SSLCertificateChainFile /etc/ssl/admin-beta.xxx.com /root_bundle.crt
powershell 复制代码
./acme.sh --install-cert -d admin-beta.xxx.com   --cert-file      /etc/ssl/admin-beta.xxx.com/admin-beta.xxx.com.crt   --key-file       /etc/ssl/admin-beta.xxx.com/admin-beta.xxx.com.key   --fullchain-file /etc/ssl/admin-beta.xxx.com /root_bundle.crt  --reloadcmd     "service httpd graceful" 

将 service httpd graceful 替换为 自己apache的重启命令

6、启动定时任务

powershell 复制代码
/root/.acme.sh/acme.sh  --cron  --home  /root/.acme.sh/

7、自动更新acme

powershell 复制代码
./acme.sh --upgrade --auto-upgrade
相关推荐
orion5717 小时前
Missing Semester Class1:course overview and introduction of shell
linux
用户120487221611 天前
Linux驱动编译与加载
linux·嵌入式
用户805533698031 天前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户805533698031 天前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
七歌杜金房2 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac
tntxia3 天前
linux curl命令详解_curl详解
linux
扛枪的书生3 天前
Linux 网络管理器用法速查
linux
顺风尿一寸3 天前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
XIAOHEZIcode3 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
唐青枫3 天前
别再只会用 cron:Linux systemd Timer 定时任务实战详解
linux