转自:https://ghost.qinan.co/debian10-install-qbittorrent-nox-with-qb-web/
Qbittorrent 是各大 pt 站几乎都支持的软件 .
而安装在 server 端的 qbittorrent 则需要使用 qbittorrent-nox 作为后端 .
此次安装选用的 web-gui 前端为 czbix 大佬自己维护的 qb-web .
安装 qbittorrent
这里说一下安装所需软件 :
- 软件前置依赖 (非必要)
- qbittorrent-nox (server 不需要 gui , 所以要安装 qbittorrent-nox)
- libtorrent (编译安装需要)
stable 库安装(方法1,推荐)
此方法最简单 , 但是因为 debian stable 有很长的维护周期 , 所以除了在刚发新版的时间段软件比较新 , 之后就显得版本很旧 .
sudo apt install -y qbittorrent-nox
编译安装(方法2,需要高版本或指定版本,推荐)
sudo apt install build-essential pkg-config automake libtool git zlib1g-dev libssl-dev libgeoip-dev
sudo apt install libboost-dev libboost-system-dev libboost-chrono-dev libboost-random-dev
sudo apt install python3
# libtorrent require
git clone https://github.com/arvidn/libtorrent.git (建议去https://github.com/arvidn/libtorrent/releases下载1.2.11版本进行编译)
cd libtorrent
#git checkout libtorrent-1_2_5
./autotool.sh
./configure --disable-debug --enable-encryption CXXFLAGS="-std=c++14"
make clean && make -j$(nproc)
# 以下两种二选一
##checkinstall 安装
sudo apt install checkinstall
sudo checkinstall --nodoc --backup=no --deldesc --pkgname libtorrent-rasterbar --pkgversion 1.2.5-source-compile
## make
sudo make install
#qb install
sudo apt install qtbase5-dev qttools5-dev-tools libqt5svg5-dev
git clone https://github.com/qbittorrent/qBittorrent
cd qBittorrent
#git checkout v4_2_x (同理,可以选择最新版本源码)
./configure CXXFLAGS="-std=c++14" --disable-gui
make -j$(nproc)
##sudo checkinstall --nodoc --backup=no --deldesc --pkgname qbittorrent-nox --pkgversion 4.2.3-source-compile
##sudo make install
配置
sudo adduser qbtuser
cat >/lib/systemd/system/qb.service <<EOF
[Unit]
Description=qBittorrent Daemon Service
Documentation=man:qbittorrent-nox(1)
Wants=network-online.target
After=network-online.target nss-lookup.target
[Service]
# if you have systemd >= 240, you probably want to use Type=exec instead
Type=simple
User=qbtuser
ExecStart=/usr/local/bin/qbittorrent-nox
#用哪个取决于你是从哪里安装的 ,
#ExecStart=/usr/local/bin/qbittorrent-nox
TimeoutStopSec=infinity
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload && sudo systemctl enable qb
#禁用 qtbuser
sudo usermod -s /usr/sbin/nologin qbtuser
sudo systemctl start qb && sudo systemctl status qb
qb-web
mkdir -p /home/github/qb-web/ && cd /home/github/qb-web
wget https://github.com/CzBiX/qb-web/releases/download/nightly-fe3cc3/qb-web-20200403-093754.zip -O /home/github/qb-web/qb-web.zip
unzip qb-web.zip
chmod 777 -R /home/github/qb-web/
现在只需要浏览器打开 http://ip:8080 -> 设置 -> WebUI 处填入 /home/github/qb-web/dist 即可 .
Tips: 如果使用 pt , 记得先进设置进行更改相关配置项 . (装软件先看设置是好文明)