Debian更新系统
apt update -y
安装curl
1:apt-get update -y && apt-get install curl -y ##Ubuntu/Debian 系统安装 Curl 方法## 2:yum update -y && yum install curl -y ##Centos 系统安装 Curl 方法##
安装宝塔面板
官网地址:https://www.bt.cn/
Dibian脚本如下
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh
解除宝塔面板强制绑定手机对话框
sed -i "s|bind_user == 'True'|bind_user == 'XXXX'|" /www/server/panel/BTPanel/static/js/index.js
安装官方Xray服务
项目地址:https://github.com/XTLS/Xray-install bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install -u root
UUID生成脚本
cat /proc/sys/kernel/random/uuid
安装完成后,在vps目录 /usr/local/etc/xray 找到 config,json 文件,粘贴以下配置信息
{ "log": { "access": "/var/log/xray/access.log", "error": "/var/log/xray/error.log", "loglevel": "error" }, "inbounds": [ { "listen": "0.0.0.0", "port": 443, "protocol": "vless", "settings": { "clients": [ { "id": "粘贴你的UUID", "level": 0, "email": "输入你的邮箱", "flow":"xtls-rprx-direct" } ], "decryption": "none", "fallbacks": [ { "alpn": "h2", "dest": 8002 } ] }, "streamSettings": { "network": "tcp", "security": "xtls", "xtlsSettings": { "serverName": "修改为你的域名", "alpn": [ "h2", "http/1.1" ], "certificates": [ { "certificateFile": "/www/server/panel/vhost/cert/修改为你的域名/fullchain.pem", "keyFile": "/www/server/panel/vhost/cert/修改为你的域名/privkey.pem" } ] } } } ], "outbounds": [ { "protocol": "freedom", "settings": { } } ] }
设置网站配置文件
server { listen 0.0.0.0:80; server_name 你的域名; return 301 https://你的域名$request_uri; } server { listen 8002 http2; server_name 你的域名; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/你的域名; add_header Content-Security-Policy "upgrade-insecure-requests";
SSH测试 Xray 配置文件
systemctl restart xray systemctl status xray
安装加速
Dibian安装BBR2
wget --no-check-certificate -q -O bbr2.sh "https://github.com/yeyingorg/bbr2.sh/raw/master/bbr2.sh" && chmod +x bbr2.sh && bash bbr2.sh auto
查看开启状态:
sysctl -p