Ubuntu 16.04安裝qbittorrent web ui


  1. 添加qBittorrent 倉庫
# apt install software-properties-common
add-apt-repository ppa:qbittorrent-team/qbittorrent-stable
  1. 安裝qBittorrent Webui
apt-get update
apt-get install qbittorrent-nox

如果想需要圖形界面的qBittorent軟件,命令和 qbittorrent-box一起

apt-get update
sudo apt-get install qbittorrent qbittorrent-nox
  1. 啟動 qbittorrent
    如果你安裝了圖形界面的qBittorrent,可以從啟動菜單中進行啟動。如果你禁用了GUI或者你只安裝了qBittorrent webui,接下來你可以以下的命令進行啟動
#qbittorrent-nox
vagrant@localhost:/home/vagrant# sudo qbittorrent-nox

*** Legal Notice ***
qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.

No further notices will be issued.

Press 'y' key to accept and continue...
y

******** Information ********
To control qBittorrent, access the Web UI at http://localhost:8080
The Web UI administrator user name is: admin
The Web UI administrator password is still the default one: adminadmin
This is a security risk, please consider changing your password from program preferences.

在你安裝了qBittorrent webui,你可以通過瀏覽器訪問(8080端口是默認監聽端口)

http://localhost:8080

如果你的 qBittorrent 是在你的局域網並且沒有屏蔽掉8080端口,當然你可以通過網絡ip進行訪問(案例如下):

http://192.168.xxx.xxx:8080

如果你有端口衍射在你的路由器上並且你有一個域名指向你運行qBittorrent webui的服務器,你或許也可以通過在瀏覽器輸入你的域名來訪問qBittorrent web ui,如

http://domain.com:8080

選擇你能接受的訪問方式,默認的用戶名和密碼:

username: admin
password: adminadmin

qbittorrent webui

我推薦你在安裝完qBittorrent webui做的第一件事情就是修改默認提供的用戶名和密碼。你可以在登錄成功之后的qBittorrent webui 中的Options(工具) -> Preferences(選項) -> Web ui(Web 用戶界面) 的驗證中進行修改 用戶名和密碼。

如果你的服務器已經有其它端口是運行在8080端口,你可以通過以下命令來指定端口進行運行:

qbittorrent-nox --webui-port=XXXX

以上的命令中,XXXX是你指定的一個唯一的數字端口。如果你沒有其它服務運行在8080端口,從安全角度看,還是建議你運行qBittorrent在一個不同的隨機端口中。

  1. qBittorrent webui 隨機啟動

通過命令的形式啟動qBittorrent 有點繁瑣或者麻煩,在開機啟動之后自動啟動qbittorrent-nox服務,創建一個/etc/init.d/qbittorrent-nox-daemon文件並填入以下內容:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          qbittorrent-nox
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starts QBittorrent
# Description:       Start qbittorrent-nox on start. Change USER= before running
### END INIT INFO

# Author: wakasann
#

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="QBittorrent"
NAME=qbittorrent-nox
DAEMON=/usr/bin/$NAME
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/qbittorrent-nox-daemon
USER=USERNAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0


case "$1" in
     start)
          echo "string $NAME"
          su - $USER -c "nohup $DAEMON $DAEMON_ARGS >/dev/null 2&1 &"
        ;;
     stop)
        echo "Stopping $NAME"
        su - $USER -c "kill -9 $(ps aux | grep -m 1 'qbittorrent-nox' | awk '{ print $2 }')"
        ;;
     *)
         echo "Usage: $NAME start|stop"
         exit 1
        ;;
esac
exit 0

你通過這個鏈接Click here to see the full code進行下載以上的代碼

Change USER=MyUserName to the name of the user whom you want to run qBittorrent daemon as. Also, change DAEMON_ARGS="--webui-port=XXXX" to the port number to which you want qBittorrent to listen. Save and exit. Set correct permissions for the file:

修改 USER=MyUserName的名字是你想在后台運行qBittorrent的用戶名,當然,修改 DAEMON_ARGS="--webui-port=XXXX"的端口號為你想qBittorrent運行的數字端口,保存並退出. 為這個文件賦予正確的權限:

chmod 755 /etc/init.d/qbittorrent-nox-daemon

然后使用下面的命令更新啟動命令:

update-rc.d qbittorrent-nox-daemon defaults #添加到開機啟動
update-rc.d qbittorrent-nox-daemon remove #從開機啟動中移除

在你下次重啟,qBittorrent webui應該會自動啟動。你也可以通過以下的start,stop命令來管理 qBittorrent-box服務

sudo service qbittorrent-nox-daemon start
sudo service qbittorrent-nox-daemon stop

為了快捷訪問,你可以參考這篇文章來創建一個 bash aliases(命令別名),舉例: qbitstart能夠執行sudo service qbittorrent-nox-daemon start。在你的/home/user/.bash_aliases中添加以下bash aliases:

alias qbitstop='sudo service qbittorrent-nox-daemon stop'
alias qbitstart='sudo service qbittorrent-nox-daemon start'
alias qbitrestart='sudo service qbittorrent-nox-daemon reload'
  1. 配置 qBittorrent

如果你決定安裝圖形界面的qBittorrent,通過桌面的形式進行配置很簡單。如果你決定安裝qBittorrent webui,你只能通過web界面修改一些設置(不是所有的配置項可以在webui中找到)。配置存放在~/.config/qBittorrent/路徑下的qBittorrent.conf文件。你可以手動配置這個文件來配置 qBittorrent。將這個文件復制為不同的文件來做備份。你可以通過以下的命令來進行編輯這個文件

vi ~/.config/qBittorrent/qBittorrent.conf

不是所有的配置項(如:Share Ratio)是可獲取的。你可以通過類似下面行的內容來手動添加share ratio到這個文件中:

BittorrentMaxRatio=2.5

保存,退出,並重啟qBittorrent。一些推薦的qBittorrent 配置信息你可以通過 github qBittorrent wikiOptimizing qBittorrent For Speed 來獲取。

  1. 啟動安全的Https 訪問呢

一個SSL鏈接提供加密和更多的隱私。首先確認你的Ubuntu 服務器安裝了openssl服務。如果沒有安裝請安裝它。接下來 創建一個證書文件如下展示:

mkdir -p ~/.config/qBittorrent/ssl
cd ~/.config/qBittorrent/ssl
openssl genrsa -des3 -out qbittorrent.cert 1024
openssl req -new -key qbittorrent-key -out qbittorrent-cert

跟着在屏幕中顯示的指示,只需要回車來選擇默認的或者你的自定義,在最后,保持challenge password為空,qbittorrent.certqbittorrent.key文件將自動生成在 ~/.config/qBittorrent/ssl/文件夾中。

然后打開qBittorrent webui設定,啟用 Https 訪問並復制qbittorrent.keyqbittorrent.cert文件的內容到KeyCertificate字段

images/201017/20201017160252.png

你應該不被允許通過Https的方式訪問qBittorrent web界面,你可能會收到一個來自瀏覽器的警告 這個證書是自簽名的,忽略這個警告。

  1. 可選

如果你想在外網中可以訪問到qBittorrent webui,啟動一個動態DNS 服務將會變得很簡單。當前支持DynDNSNO-IP


其它:

  1. 目前我從 oneprovider seedbox rutorrent中下載好的文件,直接用我自己的電腦通過ftp的方式進行下載,很慢。需要從阿里雲服務器中轉一次。
    如從遠程中復制一個文件到本地:
# scp -r 遠程用戶名@遠程ip:遠程文件 本地的絕對路徑
scp -r vagrant@localhost:/home/vagrant/test_file.txt /home/vagrant

然后再從阿里雲服務器中轉。

因為阿里雲自己買的是輕應用服務器(之前是因為公司網絡訪問Paypal訪問太慢,所以自己購買了一台阿里雲的香港服務器,做遠程桌面,測試自己程序對接paypal的效果),是配置最低的,把阿里雲服務器當作torrent下載擔心是違法的,所以不敢在阿里雲服務器做個人的torrent下載工具。兩個服務器合起來一個月大概100元左右,還是覺得有點高,也只會嘗試1個月,1個月之后就不續了。

另外一種方法加速下載的,使用http方式.
oneprovider seedbox系統是默認安裝了Apache,阿里雲的服務器中也安裝Apache,

  1. 將oneprovider中的一個文件復制到 apache 默認的/var/www/html 文件夾下
#FROM oneprovider主機
#cd 待下載文件的目錄
cd ~/Downloads
#cp 源文件名稱 /var/www/html
cp 1.jpg /var/www/html
#FROM 阿里雲主機
cd /var/www/html
#wget http://oneproviderip/源文件名稱
wget http://xxx.xxx.xxx.xxx/1.jpg

然后本地使用idm,先在下載中,設置連接的最大連接數為8。然后在任務中,新建任務,地址填入阿里雲服務器ip/+文件名詞,如: http://127.0.0.1/1.jpg

  1. pt是什么平台?

    (PT(Private Tracker)是一種改良自BitTorrent協議的P2P下載方式).Private Tracker”指私有種子服務器

看完一些回答之后,自己唯一擔心的是: 當自己的帳號以后進行共享資源了,帳號被PT站給刪除掉了,不清楚以后是否可以再次注冊。因為PT圈子原因,發現PT站的開放注冊是關閉的,部分也是需要邀請的方式進行注冊。我也是因為BT下載太慢,才知道PT和去了解PT是什么。

  1. 在什么值得買網站,知道 All in One主機DJI MANIFOLD2-C,MSI Cubi N主機 等名詞,Nas主機也是,太多想買,因為窮,也只能看看和了解,有點浪費時間呀。

Ubuntu 16.04開啟BBR

Ubuntu開啟BBR的前提是內核必須等於高於4.9,需要先看看你使用的Ubuntu系統的內核是否是4.9或者以上。

查看命令:uname -a

如果是4.9或者以上,升級內核這一步你就可以跳過了,如果在4.9以下,那就需要更新一下內核了;

  1. Ubuntu內核升級

升級過程中其實比較簡單,先確定你的系統是32位還是64位的,可以用下面的命令查看
查看命令:getconf LONG_BIT
確定系統之后,需要到以下的鏈接進行下載必要的升級程序包
http://kernel.ubuntu.com/~kernel-ppa/mainline/
這個網站可以找到最新的程序包,根據自己的需要使用wget命令來下載到服務器;
比如我的服務器是64位,安裝4.10.2的內核:

sudo wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.2/linux-image-4.10.2-041002-generic_4.10.2-041002.201703120131_amd64.deb

(擁有root權限的話可以去掉命令前面的“sudo”)

然后切換到你的文件下載目錄,執行下列命令來升級

sudo dpkg -i linux-image-4.10.2-041002-generic_4.10.2-041002.201703120131_amd64.deb

最后,執行命令 sudo update-grub,更新grub引導裝入程序。

一旦各方面都已完成,重啟機器,你就可以准備使用了。系統重啟后,打開終端窗口,可再次執行命令uname -a來查看你實際上是否是在運行你更新之后的內核。

  1. 開啟TCP BBR

修改系統變量:

sudo bash -c 'echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf'
sudo bash -c 'echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf'

保存生效

sysctl -p

執行以下命令查看是否開啟成功

sysctl net.ipv4.tcp_available_congestion_control

如果顯示的結果是:

net.ipv4.tcp_available_congestion_control = bbr cubic reno

這樣BBR就開啟成功了。

也可以執行 lsmod | grep bbr 來檢測 BBR 是否真的開啟成功

  1. 關閉BBR

修改配置文件

sudo vi /etc/sysctl.conf

進入配置文件,剛才開啟添加的內容在最后,可按G直接調到文件末尾,然后按i鍵或Insert鍵開啟編輯模式,使用#注釋或刪除內容后,按ESC鍵退出編輯,鍵入:wq 進行 保存並退出

#net.core.default_qdisc=fq
#net.ipv4.tcp_congestion_control=bbr

然后保存配置

sysctl -p

然后重啟機器,重啟完之后,登錄機器系統的ssh,執行 lsmod | grep bbr 命令來檢測 BBR 是否已關閉

References


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM