在Centos7上安装cloudflare warp
因为chatgpt访问限制,可通过cloudflare warp绕过限制,但官方只提供了对centos 8版本的支持,而我的vps是centos7系统,安装warp时踩了一些坑,记录一下安装步骤
- 进入https://pkg.cloudflareclient.com/packages/cloudflare-warp 下载centos版本的安装包
- 执行rpm -ivh cloudflare_warp_2023_3_398_1_x86_64_e9b71b3326.rpm,出现错误提示
error: Failed dependencies:
desktop-file-utils is needed by cloudflare-warp-2023.3.398-1.x86_64
nftables is needed by cloudflare-warp-2023.3.398-1.x86_64
- 安装缺少的依赖
yum install -y desktop-file-utils
yum install -y nftables
- 再次安装客户端成功,执行systemctl start warp-svc启动服务
- 执行warp-cli register,提示
warp-cli: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by warp-cli)
warp-cli: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by warp-cli)
warp-cli: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by warp-cli)
- 安装glibc
wget https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
tar -xzvf glibc-2.28.tar.gz
cd glibc-2.28
mkdir build && cd build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
提示These critical programs are missing or too old: make bison compiler
- 安装bison
yum install -y bison
- 再次编译提示These critical programs are missing or too old: make compiler, 查看INSTALL文件提示gcc版本要求4.9以上,make版本需要4.0以上,当前系统这俩版本分别为4.8.5和3.82
- 升级gcc
yum install -y centos-release-scl
yum install -y devtoolset-8-gcc*
echo "source /opt/rh/devtoolset-8/enable" >> /etc/profile
source /etc/profile
此时执行gcc -v显示版本为8.3.1 10. 升级make
wget https://ftp.gnu.org/gnu/make/make-4.3.tar.gz
tar -xzvf make-4.3.tar.gz
cd make-4.3
./configure --prefix=/usr/local/make
make && make install
cd /usr/bin
mv make make-3.82
ln -sv /usr/local/make/bin/make /usr/bin/make
- 继续编译glibc
cd /root/glibc-2.28/build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make && make install
- 启动warp代理
warp-cli register
warp-cli set-mode proxy
warp-cli connect
curl ifconfig.me --proxy socks5://127.0.0.1:40000 #测试是否成功
- v2 分流配置
{
"routing": {
"domainStrategy": "AsIs",
"rules": [{
"type": "field",
"outboundTag": "warp_proxy",
"domain": [
"openai.com",
"bing.com"
]
}]
},
"outbounds": [{
"protocol": "freedom",
"settings": {}
},
{
"tag": "warp_proxy",
"protocol": "socks",
"settings": {
"servers": [{
"address": "127.0.0.1",
"port": 40000
}]
}
}
]
}