这个教程是在免费的容器型 VPS 上进行演示的,在真实的 VPS 装操作略有不同,主要目的是应用于教学演示 让没有 VPS 的朋友也能体验一下怎样编译,视频教程在页末。
创建一个容器 我选择的是美国地区 名称命名一下 其他的基本上不用做任何的改动 直接点击右上角的创建 create,稍等片刻,然后点 run container 运行
由于它是用 docker 创建的容器行 VPS 需要执行下面的命令才能正常运行 在终端窗口
root@goorm:/workspace/111#
左下角 CPU 占用率会标红 执行过程中会出现报错无需担心 直接忽略掉 可能会卡住 只能耐心等待 大约需要 8 分钟apt update;apt -y install language-pack-en;apt upgrade -y
下面开始真正的编译步骤, 编译之前安装一些需要的东西,大约需要 1 分钟 安装 unzip、zip
apt install unzip zip -y
snap 似乎没法在这个容器型 VPS 上安装 安装 golang
wget -q -O - https://git.io/vQhTU | bash
source .profile
go version
使用 v2ray 官方的脚本编译, 这里我只需要 v2ray 和 v2ctl, 随着 v2ray 的更新, 将来可能不需要 v2ctl 啦 编译需要 5mins+
cd;rm -fr v2ray-core v2ray-custom*.zip;bash <(curl -sL https://raw.githubusercontent.com/v2fly/v2ray-core/master/release/user-package.sh) nodat noconf codename=nonedotblue
安装 v2ray v2ctl 设置系统环境变量 并给予可执行权限
unzip v2ray-custom*.zip -d /usr/local/bin/;chmod +x /usr/local/bin/{v2ray,v2ctl}
大功告成,自编译 v2ray,版本号 4.32 编译者 nonedotblue,编译时间今天
root@goorm:~# v2ray -version
V2Ray v4.32.0 (nonedotblue) 20201104-055938 (go1.15.3 linux/amd64)
A unified platform for anti-censorship.video-tutorial
How was it? Did this tutorial work? Yes No