Linux安装qBittorrent-Enhanced-Edition
/ 3 min read
Updated:目录
下载可执行文件
#x86_64download_url=$(curl -s https://api.github.com/repos/c0re100/qBittorrent-Enhanced-Edition/releases/latest | jq -r '.assets[] | select(.name | test("qbittorrent-enhanced-nox_x86_64-linux-musl_static.zip")) | .browser_download_url') && \curl -L $download_url -o /usr/bin/qbittorrent-nox.zip && \unzip /usr/bin/qbittorrent-nox.zip -d /usr/bin/ && \chmod +x /usr/bin/qbittorrent-nox && \rm /usr/bin/qbittorrent-nox.zip#arm64download_url=$(curl -s https://api.github.com/repos/c0re100/qBittorrent-Enhanced-Edition/releases/latest | jq -r '.assets[] | select(.name | test("qbittorrent-enhanced-nox_aarch64-linux-musl_static.zip")) | .browser_download_url') && \curl -L "$download_url" -o /usr/bin/qbittorrent-nox.zip && \unzip /usr/bin/qbittorrent-nox.zip -d /usr/bin/ && \chmod +x /usr/bin/qbittorrent-nox && \rm /usr/bin/qbittorrent-nox.zip创建system服务
cat > /etc/systemd/system/qbittorrent.service <<EOF[Unit]Description=qBittorrent Daemon ServiceAfter=network-online.target
[Service]Type=simpleUser=rootGroup=rootUMask=007ExecStart=/usr/bin/qbittorrent-noxExecStop=/bin/kill -s SIGTERM $MAINPIDRestart=on-failure
[Install]WantedBy=multi-user.targetEOF启动
systemctl enable qbittorrentsystemctl start qbittorrentsystemctl status qbittorrent # 查看登录密码,默认登录端口8080下载完后上传网盘
#创建日志文件夹mkdir -p /root/rclone_logs#下载完成后执行命令,bt:/bt自行修改为你设置rclone remote名和上传到网盘的路径rclone move "%F" "bt:/bt/%N" --create-empty-src-dirs --transfers=4 --checkers=4Nginx反代
#安装所需程序sudo apt install certbot python3-certbot-nginx python3-certbot-dns-cloudflare nginx#手动编辑sudo nano /etc/nginx/sites-available/bt#这里是nginx配置路径为conf.d的配置,下面启用配置命令不用sudo nano /etc/nginx/conf.d/bt.conf#启用配置sudo ln -s /etc/nginx/sites-available/bt /etc/nginx/sites-enabled/#从Cloudflare获取区域DNS APIsudo nano /etc/letsencrypt/cloudflare.inidns_cloudflare_api_token = 你的API#赋予权限sudo chmod 600 /etc/letsencrypt/cloudflare.ini#使用CF-DNS申请证书,你不想关小黄云用这个,全程y就行sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini -d example.com#直接申请证书,上面的申请完后可以用这个命令自动配置HTTPS,选1sudo certbot --nginx -d example.com配置示例
server { listen 80; # 端口可以随意修改 listen [::]:80; # IPv6 监听,同样可修改
#server_name _; server_name example.com; # 也可以写多个域名,用空格分隔
location / { proxy_pass http://127.0.0.1:8080; # 代理到本地 8080 端口 proxy_set_header Host $host; # 保留原始 Host 头 proxy_set_header X-Real-IP $remote_addr; # 真实客户端 IP proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # 协议(http/https) }}内存占用解决办法
在设置高级中将磁盘 IO 类型设置为遵循 POSIX