云服务器+BT+V2ray+SSL

  • 1、购买云服务器,阿里云,腾讯,谷歌。。。
  • 2、系统可以是Centos ,
  • 3、升级系统

yum clean all
yum makecache
yum update

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

  • 5、安装nginx,php,mysql,用于网站正常使用,如果不需要可以只安装nginx
  • 6、申请域名并解析到云服务器
  • 7、添加网站,填入域名并提交

  • 8、添加SSL

  1. 一种方法是自己申请SSL 证书,另外一种是使用宝塔自动申请SSL证书,方法很简单,下面只介绍第一种,
    1. 自己申请并下载证书,选择nginx服务器证书,
    2. 添加证书,下载的证书有后缀为.key 和.pem 的文件,分别填入ssl证书的左右边

配置反向代理,可以根据自己情况设定,

      location /xray 
    {
        proxy_pass http://127.0.0.1:8443;#8443为xray里自己设定的端口
        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_read_timeout 300s;
    }

  • 9、安装V2ray

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

  • 10、获取UUID,并保存好这串值,

cat /proc/sys/kernel/random/uuid

  • 11、配置v2ray配置文件 ,路径/usr/local/etc/v2ray/config.json,加入如下内容,根据自己实际情况修改下,有三个地方需要修改,记得删除红字

{
  "policy": {
    "levels": {
      "0": {
        "uplinkOnly": 0,
        "downlinkOnly": 0,
        "connIdle": 150,
        "handshake": 4
      }
    }
  },
  "inbound": {
    "listen": "127.0.0.1",
    "port": 8443,这里是v2ray监听端口,可以自己设置,但要和宝塔里的一致
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "这里填入上面获取的UUID的值",
          "level": 1,
          "alterId": 32
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "security": "auto",
      "wsSettings": {
        "path": "/xray",
        "headers": {
          "Host": "这里改成添加的域名,例如www.xxx.com"
        }
      }
    }
  },
  "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"
        }
      ]
    }
  }
}

  • 12、启动v2ray

systemctl start v2ray.service

其他命令,分别为,开机启动v2ray,重启v2ray,停止v2ray

systemctl enable v2ray.service
systemctl restart v2ray.service
systemctl stop v2ray.service

查看v2ray运行端口是否正常

netstat -anp | grep 端口号

  • 至此,服务器上面的配置已经完成,


电脑上面 配置和使用v2ray

  • 1、下载V2rayN

https://www.github.com/2dust/v2rayN/releases

  • 2、配置,如图,或者按自己实际情况填写

  • 3、如果配置一切正常,那么一个新的人字梯就做好了
  • 4、现在PC上面默认的代理端口为Socks5 10808,http 10809;


使用梯子,1、浏览器使用,2,全局使用

  • 全局使用

右键V2ray图标,系统代理——>自动配置系统代理

这样选择以后,系统所有流量都将使用代理

  • 浏览器使用

firefox或者chrome,安装Proxy SwitchyOmega插件,并配置即可,

  • 愉快的上网看视频吧