基于Centos7安装宝塔+v2
更改VPS系统时间(可选开启时间同步)
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
NTP同步时间 协议(可选择跳过)
yum install ntp ntpdate -y
接下来我们需要先停止NTP服务器,再更新时间
service ntpd stop #停止ntp服务
ntpdate us.pool.ntp.org #同步ntp时间
service ntpd start #启动ntp服务
Centos安装宝塔面板
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
安装v2ray服务器:官方脚本.
bash <(curl -L -s https://install.direct/go.sh)
vi /etc/v2ray/config.json
V2RAY服务器的配置文件如下:(下面代码可以直接覆盖源文件代码)
{
"inbounds": [{
"port": 65432, //此处为安装时生成的端口,可修改随意,但是保证和下面提到的端口号相同
"listen":"127.0.0.1",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "XXXXXXXXX", //此处为安装时生成的 id
"level": 1,
"alterId": 64 //此处为安装时生成的 alterId
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/SoftDown/down" //此处为路径,需要和下面 NGINX 上面的路径配置一样
}
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
},{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}
宝塔设定网站,申请SSL后,更改网站配置文件,在最后添加:
location /SoftDown/down {
proxy_redirect off;
proxy_pass http://127.0.0.1:65432;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
最后重启服务,配置客户端。