自己总结的安装V2RAY+TLS的过程
虽然有一键脚本,但是纯粹的是为了翻墙,好像没有PHP,也没有vhost的设置等等.
如果我在现有的网站VPS,增加V2RAY的功能.还是用如下的方式比较好.
1,设置LNMP
wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz
tar zxvf oneinstack-full.tar.gz
cd oneinstack
./install.sh
设置一大堆.
2,一键安装了V2RAY
bash <(curl -L -s https://install.direct/go.sh)
上面的命令已经失效了。
需要改成下面的:
curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
bash install-release.sh
systemctl enable v2ray
systemctl start v2ray
安装完之后呢.要改一下参数.下面的port,id,path自己更改
vim /usr/local/etc/v2ray/config.json
{
"inbounds": [
{
"port":23333,
"listen": "127.0.0.1",
"tag": "vmess-in",
"protocol": "vmess",
"settings": {
"clients": [
{
"id":"9999d32c-5719-4fd5-ba8d-569b0b150888",
"alterId":64
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path":"/t00ls.kele/"
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": { },
"tag": "direct"
},
{
"protocol": "blackhole",
"settings": { },
"tag": "blocked"
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"inboundTag": [
"vmess-in"
],
"outboundTag": "direct"
}
]
}
}
改完之后
service v2ray start
3,设置虚拟主机
cd oneinstack
./vhost.sh
又是一大堆的设置,比如域名是s1.gg.com
添加完虚拟主机之后,
更改/usr/local/nginx/conf/vhost/s1.gg.com.conf
添加:
location /t00ls.kele/
{
proxy_redirect off;
proxy_pass http://127.0.0.1:23333;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
4,设置防火墙
我不爱用iptables,先停掉
systemctl stop iptables.service
systemctl disable iptables.service
启用firewalld
yum -y install firewalld
systemctl unmask firewalld.service
systemctl start firewalld.service
systemctl enable firewalld.service
firewall-cmd --zone=public --add-port=22/tcp --permanent
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-all
5,手动设置各个客户端就可以了.
地址(address):s1.gg.com
端口(port):443
ID:9999d32c-5719-4fd5-ba8d-569b0b150888
alterId:64
加密(security):auto
传输协议(network):ws
伪装类型(type):none
path:/t00ls.kele/
底层传输安全:tls
最后,网上有人做的一键脚本:
bash <(curl -L -s https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh) | tee v2ray_ins.log