之前做过,但没有记录。这次再搞一遍。
主要参考的这篇 – https://www.v2rayssr.com/v2raybaota.html
内存不够,增加SWAP
这个机子只有1G内存,我把SWAP增加到了3G。具体方法本馆档案。
开启BBR
时间同步
Shell
x
6
1
rm -rf /etc/localtime
2
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
3
apt update -y && apt-get install ntp ntpdate -y
4
service ntpd stop #停止ntp服务
5
ntpdate us.pool.ntp.org #同步ntp时间
6
service ntpd start #启动ntp服务
安装宝塔
参考原始页面 – https://www.bt.cn/bbs/thread-19376-1-1.html
Shell
xxxxxxxxxx
1
1
1
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh
如果顺利完成,就会出现这样的结果

按提示登陆,会出现类似这样的界面;当时我忘了截屏,但这是我的选项
由于宝塔主要优化于Centos,对于Ubuntu,选择“编译安装”最为稳妥。

- nginx 1.18
- mysql 5.6
- php-7.3
- pureftpd-1.0
- pmyadmin-5.0
编译安装大概要1小时,安装成功后,最好做这些
- 先放行新端口,然后改变面板端口
- 关闭安全入口
- 修改面板用户和面板密码

安装v2ray Docker – 参考 https://nine.im/V2Ray-Vmess-due-to-AEAD-14141863a706438abb749e2319191f4c
安装v2ray服务器:官方脚本
Shell
xxxxxxxxxx
1
53
53
1
# check https://github.com/v2fly/fhs-install-v2ray
2
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
3
4
5
# 修改V2RAY服务器的配置文件如下:(下面代码可以直接覆盖源文件代码)
6
UUID=162dfc96-xxxx-49c03876398e
7
cat > /usr/local/etc/v2ray/config.json <<EOF
8
{
9
//"log": {
10
//"loglevel": "debug",
11
//"access": "/etc/v2ray/access.log", // 这是 Linux 的路径
12
//"error": "/etc/v2ray/error.log"
13
//},
14
"inbounds": [{
15
"port": 65432, //此处为安装时生成的端口,可修改随意,但是保证和下面提到的端口号相同
16
"listen":"0.0.0.0", // if just accessed from local, can use 127.0.0.1
17
"protocol": "vmess",
18
"settings": {
19
"clients": [
20
{
21
"id": "${UUID}", //此处为安装时生成的 id
22
"alterId": 0 //此处为安装时生成的 alterId
23
}
24
]
25
},
26
"streamSettings": {
27
"network": "ws",
28
"wsSettings": {
29
"path": "/SoftDown" //此处为路径,需要和下面 NGINX 上面的路径配置一样
30
}
31
}
32
}],
33
"outbounds": [{
34
"protocol": "freedom",
35
"settings": {}
36
}],
37
"routing": {
38
"rules": [
39
{
40
"type": "field",
41
"ip": ["geoip:private"],
42
"outboundTag": "direct"
43
}
44
]
45
}
46
}
47
EOF
48
49
# 配置V2Ray的自动
50
systemctl daemon-reload
51
systemctl enable v2ray
52
systemctl restart v2ray
53
systemctl status v2ray
签发SSL证书
先去CloudFlare上建立dns record. 再去宝塔开启SSL。可以打开“强制HTTPS”

配置nginx for v2ray
Shell
xxxxxxxxxx
1
8
1
location /SoftDown {
2
proxy_redirect off;
3
proxy_pass http://127.0.0.1:65432;
4
proxy_http_version 1.1;
5
proxy_set_header Upgrade $http_upgrade;
6
proxy_set_header Connection "upgrade";
7
proxy_set_header Host $http_host;
8
}

打开CloudFlare的CDN Proxy
这样就隐藏后面的IP,并利用CloudFlare的网络节点进行加速了

客户端配置
Shell
xxxxxxxxxx
1
12
12
1
- name: "v2_jp_gcjp200g 绿云日本1T@1G 年付24刀 ***保留"
2
type: vmess
3
server: xx.ck.mk
4
port: 443
5
uuid: 162dfc96-自己的UUID-49c03876398e
6
alterId: 64
7
cipher: auto
8
tls: true
9
network: ws
10
ws-path: /SoftDown
11
Host: xx.ck.mk
12
skip-cert-verify: true #默认false
测速
直连 vs 打开CloudFlare CDN (2020_07_19 2330pm 上海)