找回密码
 立即注册
搜索
查看: 306|回复: 0

2023版宝塔面板搭建v2ray共存并开启bbr加速

[复制链接]

80

主题

3

回帖

309

积分

中级用户

积分
309
发表于 2023-8-27 03:19:21 | 显示全部楼层 |阅读模式
本帖最后由 疯狂IT 于 2023-8-27 03:25 编辑

UUID在线生成:https://1024tools.com/uuid


1、安装宝塔:

安装nginx
安装完宝塔后进入后面直接一键安装即可(一键安装lnmp环境即可)




安装v2ray
宝塔和nginx完成以后,回到vps SSH窗口,执行命令

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

执行完后,回到宝塔面板,左侧文件,依次打开,编辑

/usr/local/etc/v2ray/config.json
打开该文件,清空后粘贴如下代码
  1. {
  2.   "log": {
  3.     "loglevel": "info",
  4.     "access": "/var/log/v2ray/access.log",
  5.     "error": "/var/log/v2ray/error.log"
  6.   },
  7.   "inbounds": [
  8.     {
  9.       "port": 10001,
  10.       "listen":"127.0.0.1",
  11.       "protocol": "vmess",
  12.       "settings": {
  13.         "clients": [
  14.           {
  15.             "id": "5870aee3-64a9-444a-8c29-1f888913c37a",
  16.             "alterId": 64
  17.           }
  18.         ]
  19.       },
  20.       "streamSettings": {
  21.         "network": "ws",
  22.         "wsSettings": {
  23.         "path": "/happy"
  24.         }
  25.       }
  26.     }
  27.   ],
  28.   "outbounds": [
  29.     {
  30.       "protocol": "freedom",
  31.       "settings": {}
  32.     }
  33.   ]
  34. }
复制代码




配置网站
在宝塔后台新建一个站点,域名那里填入v2ray需要的那个域名,需提前购买。


站点创建好后,在SSL那里申请免费的SSL证书


然后点击配置文件,在配置文件最顶部添加以下代码

  1. # 定义变量
  2. map $http_upgrade $connection_upgrade {
  3.   default upgrade;
  4.   ''      close;
  5. }
复制代码


然后大概这个位置(如下图)添加以下代码

  1. #v2配置文件
  2. location /happy {
  3.     proxy_pass       http://127.0.0.1:10000;
  4.     proxy_redirect             off;
  5.     proxy_http_version         1.1;
  6.     proxy_set_header Upgrade   $http_upgrade;
  7.     proxy_set_header Connection "upgrade";
  8.     proxy_set_header Host      $http_host;
  9.     }
复制代码
然后大概这个位置(如下图)添加以下代码
111.jpg





回到vps SSH窗口


启动v2ray

  1. systemctl start v2ray
复制代码


设置开机自启

  1. systemctl enable v2ray
复制代码


【推荐】安装 bbrplus 加速

centos代码如下

  1. wget -N --no-check-certificate "https://raw.githubusercontent.com/dlxg/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
复制代码


安装完BBR后可以优化配置后启用。
宝塔-安全-开放这个端口

2.jpg 110.png






回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|企业IT论坛

GMT+8, 2025-8-24 08:06 , Processed in 0.159297 second(s), 27 queries .

Powered by ITGGG.com

© 2016-2025

快速回复 返回顶部 返回列表