如何在 Ubuntu 20.04 上安裝 uTorrent


本教程將向您展示如何做到這一點 在 Ubuntu 20.04 上安裝 uTorrent..它還包括以下步驟 uTorrent 服務器自動啟動 如何在 Ubuntu 上設置反向代理 Apache Web 服務器並使用 Nginx / 為那些想要通過域名訪問 uTorrent 的人。

注意:適用於 Linux 的 uTorrent 客戶端已經 7 年沒有更新了。 我們建議您在 Ubuntu 上安裝 DelugeBit Torrent 客戶端。

Linux 本機 uTorrent 客戶端是一個基於 Web 的應用程序。換句話說,您將在您的網絡瀏覽器中使用 uTorrent。這個應用程序的正式名稱是uTorrent服務器,它的特點是:

  • 分佈式哈希表 (DHT)
  • UPnP 端口映射
  • NAT-PMP 端口映射
  • 上傳速率限制
  • 下載速率限制
  • 柱子
  • 對等點同時上傳的可配置限制
  • 增量文件分配
  • 塊級揀選
  • 用於檢查和下載文件的單獨線程
  • 用於多個 torrent 下載的單線程和單端口
  • BitTorrent 擴展協議
  • 支持多跟踪器擴展
  • 擴大公平貿易
  • 緊湊型跟踪器擴展
  • 快速簡歷
  • 無法快速恢復時對 torrent 文件進行隊列檢查
  • HTTP 洪流支持
  • 從其他 BitTorrent 客戶端恢復部分下載
  • 文件大小超過 2GB
  • 有選擇地下載多文件種子
  • IPv6
  • 高性能網絡堆棧
  • 具有動態擁塞控制的 uTP-Advanced 基於 UDP 的傳輸

如何在 Ubuntu 20.04 上安裝 uTorrent

最新版本的 uTorrent for Linux 是為 Ubuntu 13.04 發布的,但它也可以在 Ubuntu 20.04 LTS 上運行。 轉到 uTorrent Linux 下載頁面並下載適用於 Ubuntu 13.04 的 uTorrent 服務器包。

或者,您可以打開終端窗口並運行以下命令從命令行下載:

64 位

wget https://download-hr.utorrent.com/track/beta/endpoint/utserver/os/linux-x64-ubuntu-13-04 -O utserver.tar.gz

32 位

wget https://download-hr.utorrent.com/track/beta/endpoint/utserver/os/linux-i386-ubuntu-13-04 -O utserver.tar.gz

下載後,將工作目錄更改為下載 uTorrent 服務器文件的目錄。然後運行以下命令解壓 tar.gz 檔案 /opt/ 目錄。

sudo tar xvf utserver.tar.gz -C /opt/

然後運行以下命令來安裝所需的依賴項。

sudo apt install libssl-dev
wget https://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb

sudo apt install ./libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb

安裝依賴項後,創建一個符號鏈接。

sudo ln -s /opt/utorrent-server-alpha-v3_3/utserver /usr/bin/utserver

使用以下命令啟動 uTorrent 服務器:默認情況下,uTorrent 服務器會監聽 0.0.0.0:8080..如果另一個服務也在監聽 8080 端口,則需要暫時停止該服務。 uTorrent 也使用端口 10000 和 6881。 -daemon 選擇在後台運行 uTorrent 服務器的選項。

utserver -settingspath /opt/utorrent-server-alpha-v3_3/ -daemon

您現在可以通過在 Web 瀏覽器的地址欄中鍵入以下文本,在瀏覽器中訪問 uTorrent Web UI:

your-server-ip:8080/gui

如果本地計算機上安裝了 uTorrent your-server-ip 什麼時候 localhost..

localhost:8080/gui

如果你的 Ubuntu 服務器有防火牆,你需要允許訪問端口 8080 和 6881。例如,如果您使用的是 UFW,請運行以下兩個命令打開端口 8080 和 6881。

sudo ufw allow 8080/tcp
sudo ufw allow 6881/tcp

筆記 /gui URL 是必需的。否則,您將收到無效請求錯誤。當提示輸入用戶名和密碼時,鍵入: admin [ユーザー名]填寫字段和[パスワード]把這一塊留白。

登錄後需要更改管理員點擊齒輪圖標,選擇密碼 Web UI 左邊的菜單。您可以更改您的用戶名和密碼。這比使用它更安全。 admin 作為用戶名。

utorrent-server-ubuntu-20.04

如果8080端口有其他服務監聽, Connectivity 在該部分中,您可以將 uTorrent 偵聽端口更改為另一個端口,例如 8081。更改端口後,您需要使用以下命令重新啟動 uTorrent 服務器:

sudo pkill utserver

utserver -settingspath /opt/utorrent-server-alpha-v3_3/ &

可以設置默認下載目錄 Directories 標籤。

utorrent-server-ubuntu-20.04-default-download-directory

在 Ubuntu 上自動啟動 uTorrent 服務器

要啟用自動啟動,您可以使用以下命令創建 systemd 服務: (Nano 是一個命令行文本編輯器。)

sudo nano /etc/systemd/system/utserver.service

將以下文本放入文件中。 請注意,不需要 uTorrent,因為它使用 systemd 來啟動 uTorrent。 -daemon 啟動命令選項。

[Unit]
Description=uTorrent Server
After=network.target

[Service]
Type=simple
User=utorrent
Group=utorrent
ExecStart=/usr/bin/utserver -settingspath /opt/utorrent-server-alpha-v3_3/
ExecStop=/usr/bin/pkill utserver
Restart=always
SyslogIdentifier=uTorrent Server

[Install]
WantedBy=multi-user.target

根據 Ctrl+O然後按 Enter 保存文檔。根據 Ctrl+X 結束。然後重新加載systemd。

sudo systemctl daemon-reload

我們不建議以 root 身份運行 uTorrent 服務器。因此,在服務文件中指定 uTorrent 服務器。 utorrent 沒有 root 權限的用戶和組。創造 utorrent 系統用戶和組使用以下命令。

sudo adduser --system --group utorrent

然後停止當前的 uTorrent 服務器。

sudo pkill utserver

使用 systemd 服務啟動 uTorrent 服務器。

sudo systemctl start utserver

啟動時啟用自動啟動。

sudo systemctl enable utserver

接下來,檢查 utserver 的狀態。

systemctl status utserver

utorrent-server-ubuntu-20.04 將自動啟動

您可以看到自動啟動已啟用並且 uTorrent 服務器正在運行。在創作時 utorrent 創建用戶和主目錄 /home/utorrent/.. 由於 utorrent 用戶具有寫入權限,我們建議您將此主目錄設置為 torrent 下載目錄。您還需要 utorrent 作為所有者 /opt/utorrent-server-alpha-v3_3/ 在目錄中運行以下命令:

sudo chown utorrent:utorrent /opt/utorrent-server-alpha-v3_3/ -R

我們建議您在下載種子時使用 VPN 隱藏您的 IP 地址。

  • 如何在 Linux 桌面上安裝和使用 ProtonVPN

注意:其餘內容適用於了解 Web 服務器和 DNS 記錄基礎知識的任何人。 如果您不知道您的 Apache / Nginx 或 DNSA 記錄是什麼,則無需執行以下步驟。

設置 Nginx 反向代理

要使用您的域名從遠程連接訪問 uTorrent 服務器,您可以配置 Nginx 反向代理。

子目錄結構

如果您的 Ubuntu 服務器已經有一個 Nginx 提供的網站,您可以配置一個現有的 Nginx 服務器塊,以便您可以從您的域名的子目錄訪問 uTorrent Web UI。

sudo nano /etc/nginx/conf.d/your-website.conf

將以下指令粘貼到服務器塊中。如果您之前更改過端口,您也需要在此處進行更改。

location /gui {
              proxy_pass https://localhost:8080;
              proxy_set_header Host $http_host;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto $scheme;
        }

保存並關閉文件。接下來,測試您的 Nginx 配置。

sudo nginx -t

如果測試成功,重新加載Nginx。

sudo systemctl reload nginx

您現在可以通過以下方式訪問 uTorrent WebUI:

your-domain.com/gui

子域配置

如果您的 Ubuntu 服務器上沒有現有網站,則需要創建一個新的服務器塊文件。 在 Ubuntu 20.04 或 Ubuntu 19.04 上安裝 Nginx。

sudo apt install nginx

啟動 Nginx 網絡服務器。

sudo systemctl start nginx

然後創建一個新的服務器塊文件 /etc/nginx/conf.d/ 目錄。

sudo nano /etc/nginx/conf.d/utserver-proxy.conf

將以下文本粘貼到文件中。交換 utorrent.your-domain.com 不要忘記使用您最喜歡的子域並為該子域創建 A 記錄。

server {
       listen 80;
       server_name utorrent.your-domain.com;
       error_log /var/log/nginx/uttorrent.error;

       location /gui {
              proxy_pass https://localhost:8080;
              proxy_set_header Host $http_host;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto $scheme;
        }
}

保存並關閉文件。接下來,測試您的 Nginx 配置。

sudo nginx -t

如果測試成功,重新加載Nginx。

sudo systemctl reload nginx

您現在可以通過以下方式訪問 uTorrent WebUI:

utorrent.your-domain.com/gui

設置 Apache 反向代理

如果您使用的是 Apache Web 服務器而不是 Nginx,請按照以下步驟設置反向代理。

安裝 Apache Web 服務器。

sudo apt install apache2

必須啟用 Apache 作為反向代理 proxy 模塊,我們也啟用 rewrite 模塊。

sudo a2enmod proxy proxy_http rewrite

接下來,創建一個 uTorrent 虛擬主機文件。

sudo nano /etc/apache2/sites-available/utorrent.conf

將以下配置放入文件中。交換 utorrent.your-domain.com 請記住使用實際域名並為其設置A記錄。

<VirtualHost *:80>
    ServerName utorrent.your-domain.com

    RewriteEngine on
    RewriteRule ^/gui(/?)(.*)$ /$2 [PT]

    ProxyPreserveHost on
    ProxyPass / https://127.0.0.1:8080/gui/
    ProxyPassReverse / https://127.0.0.1:8080/gui/
</VirtualHost>

保存並關閉文件。然後啟用這個虛擬主機。

sudo a2ensite utorrent.conf

重新啟動 Apache 以使更改生效。

sudo systemctl restart apache2

現在子域(utorrent.your-domain.com ) 瀏覽器地址欄。 如果 uTorrent Web UI 未加載,您需要刪除默認虛擬主機文件並重新啟動 Apache Web 服務器。

啟用 HTTPS

要加密 HTTP 流量,請安裝 Let’s Encrypt 頒發的免費 TLS 證書並啟用 HTTPS。通過運行以下命令在 Ubuntu 20.04 或 Ubuntu 19.04 服務器上安裝 Let’s Encrypt 客戶端 (certbot):

sudo apt install certbot

如果要使用 Nginx,還需要安裝 Certbot Nginx 插件。

sudo apt install python3-certbot-nginx

然後運行以下命令獲取並安裝 TLS 證書。

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d utorrent.your-domain.com

如果您使用 Apache,請安裝 Certbot Apache 插件。

sudo apt install python3-certbot-apache

運行此命令以獲取並安裝 TLS 證書。

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d utorrent.your-domain.com

在哪裡

  • --nginx: 使用 nginx 插件。
  • --apache: 使用 Apache 插入。
  • --agree-tos: 我接受使用條款。
  • --redirect: 301 通過重定向強制 HTTPS。
  • --hsts:將 Strict-Transport-Security 標頭添加到所有 HTTP 響應。強制瀏覽器始終對域使用 TLS。 防止 SSL / TLS 剝離。
  • --staple-ocsp:啟用 OCSP 訂書釘。有效的 OCSP 響應被裝訂到 TLS 期間服務器提供的證書。

現在將自動獲取並安裝證書。

uTorrent 服務器 Linux

您現在可以通過以下方式訪問 uTorrent 服務器。 https://utorrent.your-domain.com/gui..

如何在 Ubuntu 上卸載 uTorrent

要刪除 uTorrent,請先停止當前的 uTorrent 進程。

sudo pkill utserver

然後刪除安裝目錄。

sudo rm -r /opt/utorrent-server-alpha-v3_3/

刪除符號鏈接。

sudo rm /usr/bin/utserver

包起來

我們希望本教程能幫助您在 Ubuntu 20.04 LTS 上安裝 uTorrent。另請查看有關如何在 Ubuntu 上安裝 Deluge 或 qBitTorrent 的教程。與往常一樣,如果您覺得這篇文章有用,請訂閱我們的免費時事通訊以獲取更多提示和技巧。照顧好自己?