多域名自动化生成证书及OpenResty使用 lua-resty-auto-ssl 配置证书

本文介绍如何使用lua-resty-auto-ssl自动化工具为100多个一级/二级域名批量部署SSL证书,通过简单的URL访问即可自动生成证书。

需求:我有100+个一级/二级域名需要做ssl证书如何处理。太多了不能手动搞,那么lua-resty-auto-ssl自动化帮你解决。只需要你访问url地址即可自动生成ssl证书。

  1. 安装OpenResty 官网推荐使用15.8.1以上:
    https://github.com/auto-ssl/lua-resty-auto-ssl

  2. 安装luarocks

wget http://luarocks.org/releases/luarocks-2.0.13.tar.gz //下载
tar -xzvf luarocks-2.0.13.tar.gz //解压
cd luarocks-2.0.13/
//这里需要注意prefix 路径跟自己的openresty安装路径是否匹配
./configure --prefix=/usr/local/openresty/luajit \
    --with-lua=/usr/local/openresty/luajit/ \
    --lua-suffix=jit \
    --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
make
sudo make install
  1. 安装组件
cd /usr/local/openresty/luajit
./luarocks install lua-resty-auto-ssl
mkdir /usr/local/openresty/ssl
mkdir /usr/local/openresty/ssl/resty-auto-ssl
chown -R nobody.nobody /usr/local/openresty/ssl/resty-auto-ssl
chmod -R 777 /usr/local/openresty/ssl

在这里插入图片描述

  1. 制作自签证书
cd /usr/local/openresty/ssl/resty-auto-ssl
openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \
  -subj '/CN=sni-support-required-for-valid-ssl' \
  -keyout /usr/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值