
動物機最主要功能就是下載,但一般 qbittorrent 是用獨立程式的方式在運行,想要啟動就能執行、遠端能進行管理的網頁服務,可以按照下列方法安裝:
安裝獨立執行程式:
1 | sudo apt install qbittorrent |
安裝 web server 版 qbittorrent-nox
1 | sudo apt install qbittorrent-nox |
一般執行這樣即可:
1 | qbittorrent-nox -d #作為背景執行 |
老方法透過 rc.local 啟動:
1 2 3 | sudo nano /etc/rc.local 加入這一行 qbittorrent-nox -d |
透過系統服務啟動,(可選)可以建立專用的使用者與其群組增加一些安全性:
1 2 | sudo adduser --system --group qbittorrent-nox # 建立群組 sudo adduser your-username qbittorrent-nox # 加入使用者 |
新增/編輯系統服務設定檔:
1 | sudo nano /etc/systemd/system/qbittorrent-nox.service |
貼上以下內容,注意 username 與 group
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | [Unit] Description=qBittorrent-nox After=network.target [Service] Type=forking # Type=simple 有建議不要 simple User=ryo # Group=qbittorrent-nox # Umask=007 RemainAfterExit=yes ExecStart=/usr/bin/qbittorrent-nox -d # 預設的 PORT 為 8080 ,如果已被占用可以手動加入指定 --webui-port=8081 Restart=on-failure [Install] WantedBy=multi-user.target |
系統服務啟動、停止、檢視狀態等命令
1 2 3 4 5 | sudo systemctl daemon-reload # 重載所有服務設定 sudo systemctl start qbittorrent-nox # 手動進行啟動 sudo systemctl status qbittorrent-nox # 檢視執行狀態,看看有沒有錯誤並且是 active 的狀態即為啟動成功 sudo systemctl enable qbittorrent-nox # 設定隨系統啟動 sudo systemctl stop qbittorrent-nox # 暫停服務 |
打開瀏覽器輸入 localhost:指定的PORT 或 ip:指定的PORT 應該就可以看到 qbittorrent-nox 的登入畫面,預設帳密為 admin / adminadmin ,如果有對外網服務,儘快到設定內改掉帳號密碼吧!