- SubConverter搭建
- 下载解压
123cd /data/wwwrootwget https://github.com/tindy2013/subconverter/releases/download/v0.7.2/subconverter_linux64.tar.gztar xzf subconverter_linux64.tar.gz - 修改配置
123#修改managed_config_prefix=http://127.0.0.1:25500为后端实际使用域名cp /data/wwwroot/subconverter/pref.example.ini /data/wwwroot/subconverter/pref.ininano /data/wwwroot/subconverter/pref.ini - 创建subconverter服务
1234567891011121314151617cat <<EOF >/etc/systemd/system/subconverter.service[Unit]Description=subconverter serverAfter=network.target[Service]Type=simpleExecStart=/data/wwwroot/subconverter/subconverterRestart=alwaysRestartSec=10LimitCORE=infinityLimitNOFILE=infinityLimitNPROC=infinity[Install]WantedBy=multi-user.targetEOF - 启动subconverter服务
12systemctl enable /etc/systemd/system/subconverter.servicesystemctl start subconverter - Nginx反代
12345location / {proxy_pass http://127.0.0.1:25500/;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;}
- 下载解压
- Sub-Web搭建
- 安装Node.js和Yarn
12345678#安装Node.jscurl -fsSL https://deb.nodesource.com/setup_16.x | bash -apt install nodejs -y#安装Yarncurl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.listapt update && apt install yarn -y - 下载安装
1234cd /data/wwwrootgit clone https://github.com/CareyWang/sub-web.gitcd /data/wwwroot/sub-webyarn install - 修改配置
12345678910111213141516171819#修改VUE_APP_SUBCONVERTER_DEFAULT_BACKEND = "https://api.wcc.best"为后端域名nano /data/wwwroot/sub-web/.env#修改backendOptions: [{ value: "http://127.0.0.1:25500/sub?" }],为后端域名nano /data/wwwroot/sub-web/src/views/Subconverter.vue#在remoteConfig: [下添加自定义配置nano /data/wwwroot/sub-web/src/views/Subconverter.vue添加{label: "自定义",options: [{label: "自用",value:"https://raw.githubusercontent.com/MoeKing/Rules/main/Clash/config.ini"}]}, - 部署
1yarn build - Nginx配置
12345678910111213root /data/wwwroot/sub-web/dist/;error_page 404 /index.html;gzip on;gzip_min_length 1k;gzip_buffers 4 16k;gzip_http_version 1.0;gzip_comp_level 6;gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;gzip_vary on;location ~* \.(css|js|png|jpg|jpeg|gif|gz|svg|mp4|ogg|ogv|webm|htc|xml|woff)$ {access_log off;add_header Cache-Control "public,max-age=30*24*3600";}
- 安装Node.js和Yarn
来源详情: [Debian]代理客户端订阅转换服务 Subconverter 及其前端 Sub-web 的搭建及使用(写于:20210112)
sub-web 搭建需要用Node.js 16 (我用的是Node.js 16.19.0)才能成功,不然会报错 >﹏<