所有分类
  • 所有分类
  • 站内首发

Xray搭建优化:一键申请SSL证书并设置自动续费

1、解析域名并放行端口

Debian&Ubuntu:ufw allow 80 Centos: firewall-cmd --zone=public --add-port=80/tcp --permanent

2、安装依赖包

apt update -y          # Debian/Ubuntu 命令 apt install -y curl    # Debian/Ubuntu 命令 apt install -y socat   # Debian/Ubuntu 命今 yum update -y          #CentOS 命令 yum install -y curl    #CentOS 命令 yum install -y socat   #CentOS 命令

3、安装acme.sh

curl https://get.acme.sh | sh -s email=my@example.com

4、立刻加载修改后设置,使之生效

source ~/.bashrc

5、申请证书

acme.sh --issue -d 你的域名 --standalone -k ec-256

6、安装Nginx

apt -y install nginx

7、在/etc/nginx目录下创建一个文件夹,并命名为ssl

8、设置证书自动续期

acme.sh --installcert -d 你的域名 --ecc  --key-file       /etc/nginx/ssl/domain.key   --fullchain-file /etc/nginx/ssl/domain.crt  --reloadcmd     "service nginx force-reload"

原文链接:https://www.ogsgame.com/xiofuli/2024/04/186511/,转载请注明出处。如有侵权,联系侵删!

0

评论0

请先

最新镜像站

限时特价,订阅玩家终身仅25元错过会后悔哦!

显示验证码
没有账号?注册  忘记密码?
隐藏
变装