phlinhng / v2ray-tcp-tls-web

VLESS / Trojan-Go / Shadowsocks 脚本 支持纯 IPv6
https://github.com/phlinhng/v2ray-tcp-tls-web/wiki
Do What The F*ck You Want To Public License
684 stars 332 forks source link

安装 TCP+TLS+WEB, v2进程启动失败。 #53

Closed sl179 closed 3 years ago

sl179 commented 3 years ago

脚本是全新安装 , vultr服务器,debian 9 ,域名解析正常,安装完成后,v2进程启动失败: root@vultr:~# ps -ef | grep v2ray root 3370 587 0 12:42 pts/0 00:00:00 grep v2ray

和之前正常的安装对比: #ps -ef | grep v2ray v2ray 21399 1 0 Sep20 ? 00:04:04 /usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json

卸载后提示: image

tls-shunt-proxy正常。 image

安装细节:

安装时的操作以及输出: 选择操作 [输入任意值退出]: 0 解析到本 VPS 的域名:x.x.x 域名 x.x.x 解析正确, 即将开始安装 info: Installing V2Ray v4.28.2 for x86_64 Downloading V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v4.28.2/v2ray-linux-64.zip Downloading verification file for V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v4.28.2/v2ray-linux-64.zip.dgst % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 649 100 649 0 0 911 0 --:--:-- --:--:-- --:--:-- 910 100 590 100 590 0 0 386 0 0:00:01 0:00:01 --:--:-- 386 info: Extract the V2Ray package to /tmp/tmp.XooUT11KMA and prepare it for installation.


info: The following are the actual parameters for the v2ray service startup.
info: Please make sure the configuration file path is correctly set.
# Duplicate this file in the same directory and make your customizes there. Or all changes you made will be lost!
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
[Service]
ExecStart=
ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json

~~~~~~~~~~~~~~~~ /etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf ~~~~~~~~~~~~~~~~
info: The following are the actual parameters for the v2ray service startup.
info: Please make sure the configuration file path is correctly set.
# Duplicate this file in the same directory and make your customizes there. Or all changes you made will be lost!
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
[Service]
ExecStart=
ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/%i.json

installed: /usr/local/bin/v2ray
installed: /usr/local/bin/v2ctl
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/v2ray@.service
removed: /tmp/tmp.XooUT11KMA
info: V2Ray v4.28.2 is installed.
You may need to execute a command to remove dependent software: apt remove curl unzip
Please execute the command: systemctl enable v2ray; systemctl start v2ray
Building v2ray.service for domainsocket
mv: missing destination file operand after '/etc/systemd/system/v2ray.service'
Try 'mv --help' for more information.
tls-shunt-proxy is not installed. start installation
https://github.com/liberal-boy/tls-shunt-proxy/releases/download/0.6.1/tls-shunt-proxy-linux-amd64.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   657  100   657    0     0    825      0 --:--:-- --:--:-- --:--:--   824
100 2917k  100 2917k    0     0  1059k      0  0:00:02  0:00:02 --:--:-- 3239k
Archive:  /tmp/tls-shunt-proxy/tls-shunt-proxy.zip
  inflating: /usr/local/bin/tls-shunt-proxy  
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   494  100   494    0     0    583      0 --:--:-- --:--:-- --:--:--   584
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3653  100  3653    0     0  12687      0 --:--:-- --:--:-- --:--:-- 12684
tls-shunt-proxy is installed.
Setting v2Ray
Setting tls-shunt-proxy
Building dummy web site
Activating services
Created symlink /etc/systemd/system/multi-user.target.wants/v2ray.service -> /etc/systemd/system/v2ray.service.
Created symlink /etc/systemd/system/multi-user.target.wants/tls-shunt-proxy.service -> /etc/systemd/system/tls-shunt-proxy.service.
安装 TCP+TLS+WEB 成功!
域名:443
c52fbc29-7460-4050-8d8c-8db5ef3000fc (aid: 0)

root@vultr:~# systemctl start  v2ray
Failed to start 2.service: Unit 2.service not found.

日志:
\#systemctl status  v2ray
● v2ray.service - V2Ray Service
   Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/v2ray.service.d
           └─10-donot_touch_single_conf.conf
   Active: failed (Result: exit-code) since Wed 2020-09-23 13:16:17 UTC; 1min 0s ago
     Docs: https://www.v2fly.org/
  Process: 3600 ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json (code=exited, st
 Main PID: 3600 (code=exited, status=255)

Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Main process exited, code=exited, status=255/n/a
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Unit entered failed state.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Failed with result 'exit-code'.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Service hold-off time over, scheduling restart.
Sep 23 13:16:17 vultr.guest systemd[1]: Stopped V2Ray Service.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Start request repeated too quickly.
Sep 23 13:16:17 vultr.guest systemd[1]: Failed to start V2Ray Service.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Unit entered failed state.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Failed with result 'exit-code'.

配置文件:
root@vultr:~# cat /usr/local/etc/v2ray/config.json
{
  "inbounds": [
    {
      "protocol": "vmess",
      "listen": "127.0.0.1",
      "port": 32936,
      "settings": {
        "clients": [
          {
            "id": "c52fbc29-7460-4050-8d8c-8db5ef3000fc",
            "alterId": 0
          }
        ]
      },
      "streamSettings": {
        "network": "domainsocket",
        "dsSettings": {
          "path": "/tmp/v2ray-ds/v2ray.sock"
        }
      },
      "sniffing": {
        "enabled": true,
        "destOverride": [ "http", "tls" ]
      }
    }
  ],
  "outbounds": [
    {
      "tag": "direct",
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag": "blocked",
      "protocol": "blackhole",
      "settings": {}
    }
  ],
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked"
      },
      {
        "type": "field",
        "protocol": [
          "bittorrent"
        ],
        "outboundTag": "blocked"
      }
    ]
  }
}
系统服务文件:
root@vultr:~# cat /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 -config /usr/local/etc/v2ray/config.json
Restart=on-failure
RestartPreventExitStatus=23

[Install]
WantedBy=multi-user.target
phlinhng commented 3 years ago

感謝回報,已於 e668e47 修復。

sl179 commented 3 years ago

修改后,v2可以正常运行. 安装完成,客户端导入vmess链接,却没有成功连上。 发现链接的alterId是1,而服务端配置文件中的alterId是0,

image

安装时的提示: Created symlink /etc/systemd/system/multi-user.target.wants/tls-shunt-proxy.service -> /etc/systemd/system/tls-shunt-proxy.service. 安装 TCP+TLS+WEB 成功! x.x.x:443 1c30b029-d0c2-475c-b63d-f654de787294 (aid: 0)


服务端的配置文件,alterId是0, #cat /usr/local/etc/v2ray/config.json (省略一部分内容) "settings": { "clients": [ { "id": "1c30b029-d0c2-475c-b63d-f654de787294", "alterId": 0 } ] }

更改alterId为1,和客户端的一致后,可以正常使用。