2020最新版V2ray官方搭建教程

2020最新版V2fly ws+tls+官方搭建教程
1:时间同步: Centos系统
1
2
3
date -R
timedatectl set-local-rtc 1
timedatectl set-timezone Asia/Shanghai
Debian系统
1
2
3
date -R
rm -rf /etc/localtime
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2:[V2fly新版项目地址](https://github.com/v2fly/fhs-install-v2ray) 安装依赖: Debian
1
2
apt update
apt install curl
CentOS
1
2
yum makecache
yum install curl
3:安装源码:
1
2
curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh
4:安裝和更新 V2Ray
1
bash install-release.sh
5:安裝最新發行的 geoip.dat 和 geosite.dat
1
bash install-dat-release.sh
6:移除 V2Ray
1
bash install-release.sh --remove
7:创建配置文件
1
vi /usr/local/etc/v2ray/config.json
配置文件内容:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
"inbounds": [
{
"port": 443, // 服务器端口
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "UUID", // V2ray客户端UUID
"alterId": 64
}
]
},
"streamSettings": {
"network": "ws", // TCP或WS
"security": "tls", // security 要设置为 tls 才会启用 TLS
"tlsSettings": {
"certificates": [
{
"certificateFile": "/etc/v2ray/v2ray.crt", // 证书文件路径
"keyFile": "/etc/v2ray/v2ray.key" // 密钥文件路径
}
]
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
8:安装软件依赖 Debian/Ubuntu系统:
1
apt-get update && apt-get install curl -y && apt-get install cron -y && apt-get install socat -y
CentOS系统:
1
yum update && yum install curl -y && yum install cron -y && yum install socat -y
9:安装 acme.sh:
1
2
curl https://get.acme.sh | sh
source ~/.bashrc
10:申请证书:
1
bash ~/.acme.sh/acme.sh --issue -d 域名 --alpn -k ec-256
11:安装证书:
1
mkdir /etc/v2ray && sudo ~/.acme.sh/acme.sh --installcert -d 域名 --fullchainpath /etc/v2ray/v2ray.crt --keypath /etc/v2ray/v2ray.key --ecc
12:证书权限设置:
1
chmod 644 /etc/v2ray/v2ray.key
13:设置重启|状态检查|开机自启
1
2
3
systemctl restart v2ray
systemctl status v2ray
systemctl enable v2ray
# [TG交流群](https://t.me/siemenstutorials) # [支付宝收款签约](https://merchant.stripay.net/) # [年付81元G口VPS](https://my.racknerd.com/aff.php?aff=1313&pid=358) # [SiemensTutorials](https://www.youtube.com/SiemensTutorials) # [VTURAY网络加速](https://www.Vturay.com) # [亚马逊测评资源网|](https://aws1688.com) # [美国住宅动态](https://mxkcloud.com)