v2ray2021年宝塔面板搭建记录

By | 2022 年 1 月 12 日 星期三 21:42

CentOS 7 64bit存在一些问题,现在以CentOS 7.5 64bit核心创建
安装BT面板
降级到7.7以去除强制登录

wget https://raw.githubusercontent.com/qimomo/btpanel-v7.7.0/main/install/src/LinuxPanel-7.7.0.zip
unzip LinuxPanel-*
cd panel
bash update.sh
cd .. && rm -f LinuxPanel-*.zip && rm -rf panel
sed -i "s|if (bind_user == 'True') {|if (bind_user == 'REMOVED') {|g" /www/server/panel/BTPanel/static/js/index.js
rm -rf /www/server/panel/data/bind.pl

在网站配置文件error_log /www/wwwlogs/域名.error.log;下面覆盖

location /bbs {
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_intercept_errors on;
        if ($http_upgrade = "websocket" ){
        proxy_pass http://127.0.0.1:10220;  #自定义端口,与下同
    }
}
}

现在全新安装都是alterId默认就是0,如果是早期安装的alterId不为0就需要服务端和客户端都需要设置为0,

修改/usr/local/etc/v2ray/config.json文件如下

{
"log" : {
  "access": "/var/log/v2ray/access.log",
  "error": "/var/log/v2ray/error.log",
  "loglevel": "warning"
},
"inbound": {
  "port": 10220, #自动生成的端口,须与Nignx设置的相一致,可自定义
  "protocol": "vmess",
  "settings": {
    "clients": [
      {
        "id": "***", #自动生成的UUID
        "level": 1,
        "alterId": 0
      }
    ]
  },
  "streamSettings": {
  "network":"ws",
  "wsSettings": {
  "path": "/bbs", #path可自定义,这里是/ws,须与Nginx和客户端的path相一致
  "headers": {
  "Host": "域名" #Host可自定于任意域名,此处没有添加
  }
  }
  }
},
"outbound": {
  "protocol": "freedom",
  "settings": {}
},
"outboundDetour": [
  {
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
  }
],
"routing": {
  "strategy": "rules",
  "settings": {
    "rules": [
      {
        "type": "field",
        "ip": [
          "0.0.0.0/8",
          "10.0.0.0/8",
          "100.64.0.0/10",
          "127.0.0.0/8",
          "169.254.0.0/16",
          "172.16.0.0/12",
          "192.0.0.0/24",
          "192.0.2.0/24",
          "192.168.0.0/16",
          "198.18.0.0/15",
          "198.51.100.0/24",
          "203.0.113.0/24",
          "::1/128",
          "fc00::/7",
          "fe80::/10"
        ],
        "outboundTag": "blocked"
      }
    ]
  }
}
}

更新:https://github.com/v2fly/fhs-install-v2ray

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

关于V2 到5.1.0不能用的问题

是这种报错的
● v2ray.service – V2Ray Service
Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/v2ray.service.d
└─10-donot_touch_single_conf.conf

Process: 3975576 ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json (code=exited, status=2)
Main PID: 3975576 (code=exited, status=2)

这种报错的

处理方式1:
rm -rf /etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf
systemctl daemon-reload
systemctl restart v2ray

systemctl enable v2ray #加入自启动
service v2ray restart #重启V2Ray服务
service v2ray status #查看v2ray是否运行

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理