RockyLinux下配置v2ray客户端 881次阅读 Centos • 学习归纳 2024-06-21 前几天起,网上闹得沸沸扬扬的docker镜像仓库国内被禁,我不以为然,直到......  因此作为替代方案,急需让服务器连上外网!所以有了本文 ------ ※本文仅供学习使用,请勿用于违法犯罪! ※Centos7将于2024年6月30日停止维护,作为替代方案我选择RockyLinux,同为rpm系,命令如出一辙。 ※境外v2ray服务端需要提前自备! V2ray项目地址↓ https://github.com/v2fly/fhs-install-v2ray v2raya项目官网↓ https://v2raya.org/ ------ ## 安装v2ray ```shell [root@VM-0-7-rockylinux ~]# curl -Ls https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh | sudo bash ```  国内环境速度太慢,随时断连 解决办法:取出链接,在浏览器打开 ```web-site https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh ``` 复制网页所有内容  创建文件install_release.sh,将网页内容贴入,找到第294行  在github.com前加入kk,保存文件并上传到服务器  使用bash命令运行脚本,可以看到已经从镜像站拉取,并自动安装 ```shell [root@VM-0-7-rockylinux ~]# bash install_release.sh ```  测试:启动v2ray并查看v2ray状态,绿灯说明状态正常 ```shell [root@VM-0-7-rockylinux ~]# systemctl start v2ray && systemctl status v2ray ```  ## 安装WEB面板v2raya 关闭v2ray ```shell [root@VM-0-7-rockylinux ~]# systemctl stop v2ray && systemctl disable v2ray ``` 前往github下载对应的v2rayaRPM包,本案例使用install_redhat_x64,请按需选择 https://github.com/v2rayA/v2rayA/releases  将文件上传到服务器  使用rpm命令安装,路径要替换成实际路径 ```shell [root@VM-0-7-rockylinux ~]# sudo rpm -i /root/installer_redhat_x64_2.2.5.2.rpm ```  启动v2raya,设置自动启动,显示状态,绿灯表示状态无问题 ```shell [root@VM-0-7-rockylinux ~]# systemctl start v2raya && systemctl enable v2raya && systemctl status v2raya ```  此时已经可以使用IP地址:2017的格式在浏览器访问WEB界面,如打不开请检查云服务器的防火墙设置 设置用户名密码,忘记用户名密码可以在**停止v2raya服务**后使用v2raya --reset-password命令重置  在v2rayN导出服务器分享URL,或在服务器端导出  填入到web界面  勾选导入的服务器,操作选择服务器,最后点击左上角启动  点击右上角设置,将系统代理启用,然后保存   测试:回到服务器,curl 谷歌,可以看到已经有返回结果,搭建成功! ```shell [root@VM-0-7-rockylinux ~]# curl www.google.com.hk ```  最后一次更新于2024-06-21 None
0 条评论