centos7 vps安装Xway

 

安装 Xray 可视化面板

更新系统

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

安装BBR加速

CentOS 8 / Debian ≥ 9 开启自带 BBR 加速 ,复制全部粘贴

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
lsmod | grep bbr



安装面板

方法一:一键安装或升级脚本

bash <(curl -Ls https://blog.sprov.xyz/v2-ui.sh)



面板常用命令

v2-ui                  # 显示管理菜单 (功能更多)
v2-ui start            # 启动 v2-ui 面板
v2-ui stop             # 停止 v2-ui 面板
v2-ui restart          # 重启 v2-ui 面板
v2-ui status           # 查看 v2-ui 状态
v2-ui enable           # 设置 v2-ui 开机自启
v2-ui disable          # 取消 v2-ui 开机自启
v2-ui log              # 查看 v2-ui 日志
v2-ui update           # 更新 v2-ui 面板
v2-ui install          # 安装 v2-ui 面板
v2-ui uninstall        # 卸载 v2-ui 面板

申请证书

一、DNS 验证申请证书

获取 Cloudflare API 令牌

在域名管理首页(右下角)找到如下图,获取 API 密钥:





安装 ACME

curl https://get.acme.sh | sh

设置 Cloudflare API 令牌

export CF_Key="5526c9fcf3a7c76f8f81c927fb53a6af4c109"
export CF_Email="623218056@qq.com"

验证 DNS 并申请证书

更改下面的域名为你自己的域名

~/.acme.sh/acme.sh --issue --dns dns_cf -d richardz.xyz -d *.richardz.xyz
mkdir /root/cert
~/.acme.sh/acme.sh --installcert -d richardz.xyz --key-file /root/cert/private.key --fullchain-file /root/cert/cert.crt
~/.acme.sh/acme.sh --upgrade --auto-upgrade
chmod -R 755 /root/cert



二、Web  验证申请证书

这种方式,需要开放 80 端口,并保持不被占用的状态,这种方式不支持泛域名。

首先安装 socat

apt install socat -y   #Debian 安装代码
yum install socat -y   #CentOS 安装代码

安装 ACME 并申请证书

更改下面的域名为你自己的域名

curl https://get.acme.sh | sh
~/.acme.sh/acme.sh  --issue -d richardz.xyz --standalone
mkdir /root/cert
~/.acme.sh/acme.sh --installcert -d richardz.xyz --key-file /root/cert/private.key --fullchain-file /root/cert/cert.crt
~/.acme.sh/acme.sh --upgrade --auto-upgrade
chmod -R 755 /root/cert

为域名添加解析

类型 A,名字 v2 (可随意),IPv4 地址填入 VPS 地址。

这样就解析了一个名为 v2.bozai3.xyz 的域名,指向为 VPS 地址。



访问并设置 Xray 管理面板

在浏览器中输入刚才解析的域名 v2.bozai3.xyz ,用户名 admin ,密码 admin

Comments

Popular posts from this blog

微服务科普

ESXi添加USB硬盘作为数据存储

油焖大虾菜谱