下面操作没有目录跳转,直接执行就可以
一、准备
有的VPS厂商系统没有默认安装这些,以ubuntu为例,其他系统使用各自的安装命令即可
apt-get install openssl cron socat curl -y
二、安装
curl https://get.acme.sh | sh -s email=my@example.com
邮件无所谓,随便填,格式对就行
三、刷新一下
source ~/.bashrc
四、生成证书
~/.acme.sh/acme.sh --issue -d mydomain.com --standalone --keylength ec-256 --force
注意生成证书时80端口没被占用,域名用自己的
五、安装证书
先创建一个文件夹
mkdir /etc/server
安装
~/.acme.sh/acme.sh --installcert -d mydomain.com --ecc --fullchain-file /etc/server/server.crt --key-file /etc/server/server.key
域名对应上一步,安装的目录和文件名按需更改