Install V2Ray on Linux

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

/etc/systemd/system/v2ray.service

[Unit]
Description=V2Ray Service
Documentation=https://www.v2fly.org/
After=network.target nss-lookup.target

[Service]
User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ExecStart=/usr/local/bin/v2ray run -config /usr/local/etc/v2ray/config.json
Restart=on-failure
RestartPreventExitStatus=23

[Install]
WantedBy=user. Target
installed: /usr/local/bin/v2ray
installed: /usr/local/share/v2ray/geoip.dat
installed: /usr/local/share/v2ray/geosite.dat
installed: /usr/local/etc/v2ray/config.json
installed: /var/log/v2ray/
installed: /var/log/v2ray/access.log
installed: /var/log/v2ray/error.log
installed: /etc/systemd/system/v2ray.service
installed: /etc/systemd/system/[email protected]
systemctl enable v2ray; systemctl start v2ray

Remove V2Ray

# bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) --remove

References
https://github.com/v2fly/fhs-install-v2ray

Pass Google Traffic through WARP with V2ray in Ubuntu

Install warp-cli

curl https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list
sudo apt update
sudo apt install cloudflare-warp

Run warp-cli in proxy mode

warp-cli --accept-tos register
warp-cli --accept-tos set-mode proxy
warp-cli --accept-tos set-proxy-port 40040
warp-cli --accept-tos connect
warp-cli --accept-tos enable-always-on

Configure xray

nano /usr/local/etc/xray/config.json
"outbounds": [
    {
        "protocol": "socks", 
        "settings": { 
            "servers":[
                {
                    "address":"127.0.0.1",
                    "port":40040
                }
            ]
        }, 
        "tag": "warp"
    }
],
"routing": {
    "domainStrategy": "AsIs",
    "rules": [
        {
            "type":"field",
            "domain":[
                "domain:google.com"
            ],
            "outboundTag": "warp"
        }
    ]
},

References
https://developers.cloudflare.com/warp-client/get-started/linux
https://pkg.cloudflareclient.com/install

Install Xray + VLESS + WS + TLS + Apache + CDN on Ubuntu

Install required Ubuntu packages

apt install -y chrony
timedatectl set-ntp true
systemctl enable chrony && systemctl restart chrony
timedatectl set-timezone Asia/Tehran
chronyc sourcestats -v
chronyc tracking -v
date

Install Certbot

sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot certonly --standalone

result

# Certificate is saved at: /etc/letsencrypt/live/example.com/fullchain.pem
# Key is saved at:         /etc/letsencrypt/live/example.com/privkey.pem

Xray

bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install -u root
# xray remove
# bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove --purge
# /etc/systemd/system/xray.service
# /usr/local/bin/xray run -config /usr/local/etc/xray/config.json
nano /usr/local/etc/xray/config.json
{
    "log": {
        "loglevel": "warning"
    },
    "inbounds": [
        {
            "port": 10002,
            "listen": "127.0.0.1",
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "559f6df4-0a3c-4f5f-bb95-d17888b16361",
                        "level": 0,
                        "email": "[email protected]"
                    }
                ],
                "decryption": "none"
            },
            "streamSettings": {
                "network": "ws",
                "security": "none",
                "wsSettings": {
                    "path": "/xray"
                }
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom", 
            "settings": { }, 
            "tag": "direct"
        }, 
        {
            "protocol": "blackhole", 
            "settings": { }, 
            "tag": "blocked"
        }
    ],
    "dns": {
    "servers": [
      "https+local://1.1.1.1/dns-query",
      "1.1.1.1",
      "1.0.0.1",
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ]
  }
}

Xray Dat Path

/usr/local/share/xray

Apache

nano /etc/apache2/apache2.conf
<VirtualHost *:80>
    Servername example.com
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =example.com
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URL} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
    # change your domain
    ServerName example.com
    # you may have a different root
    DocumentRoot /var/www/
    # the SSL configuration enable https for your site and it’s also required by shadowsocks + v2ray
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/example.com/privkey.pem
    SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 +TLSv1.2 +TLSv1.3
    SSLCipherSuite HIGH:!aNULL
    <Location "/xray">
    ProxyPass ws://127.0.0.1:10002/xray
    ProxyAddHeaders Off
    ProxyPreserveHost On
    RequestHeader append X-Forwarded-For %{REMOTE_ADDR}s
    </Location>
</VirtualHost>

References
https://github.com/XTLS/Xray-core
https://github.com/XTLS/Xray-examples
https://github.com/v2fly/v2ray-examples
https://github.com/XTLS/Xray-install

Install Shadowsocks with v2ray-plugin

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean && sudo apt-get install build-essential haveged -y
## Ubuntu 18.04/16.04 or Debian 9
wget -O ubuntu-ss-install.sh https://github.com/M3chD09/shadowsocks-with-v2ray-plugin-install/raw/master/ubuntu-ss-install.sh
chmod +x ubuntu-ss-install.sh
./ubuntu-ss-install.sh
# Manage shadowsocks with systemctl
systemctl status shadowsocks
systemctl start shadowsocks
systemctl stop shadowsocks
nano /etc/shadowsocks-libev/config.json
{
    "server":"0.0.0.0",
    "server_port":80,
    "password":"PASSWORD",
    "timeout":300,
    "user":"nobody",
    "method":"aes-256-gcm",
    "nameserver": "8.8.8.8",
    "fast_open":true,
    "reuse_port":true,
    "no_delay":true,
    "plugin":"/etc/shadowsocks-libev/",
    "plugin_opts":"server"
}

References
https://github.com/M3chD09/shadowsocks-with-v2ray-plugin-install
https://gist.github.com/rampageX/134fa08a547d4b1eabd754c279b12676