PT入门

如何在CentOS 8 / RHEL 8服务器上安装qBittorrent

你可以在headless的CentOS 8/RHEL 8服务器上安装qBittorrent命令行客户端,并通过qBittorrent的web界面进行管理(你可以在web浏览器中控制它)。SSH进入你的CentOS 8/RHEL 8服务器,运行以下命令安装qBittorrent守护进程。
sudo dnf install epel-release
sudo dnf install qbittorrent-nox
请注意,我们需要安装qbittorrent-nox,而不是qbittorrent。qBittorrent-nox旨在通过其功能丰富的Web UI进行控制,默认情况下可访问该UI http://localhost:8080地址。Web用户界面的访问更加安全,默认的账户用户名是 "admin",密码是 "adminadmin"。您可以通过以下方式启动qBitorrent-nox:
qbittorrent-nox
但是,建议不要以这种方式启动qBittorrent-nox,因为在运行时无法运行其他命令。按下Ctrl+C以立即退出。我们可以创建一个systemd服务单元,以便它可以在后台运行,并在系统启动时自动启动。
该qbittorrent-nox软件包随附了所需的systemd服务文件。在/usr/lib/systemd/system/目录下,您将找到一个[email protected]文件。通过运行以下命令,使qbittorrent-nox在启动时自动启动。替换username为您的实际用户名。
sudo systemctl enable [email protected]
现在,我们可以使用以下命令启动qBittorrent服务。
sudo systemctl start [email protected]
检查状态
systemctl status [email protected]

提示:如果上述命令没有立即退出,请按Q以获得对终端的控制权。
我们可以看到qBittorrent自动启动已启用并且正在运行。

mktorrent 制作私人种子

在 Windows OS 上,可以比较方便的使用qBittorrent等软件来制作和发布种子。 怎么在(无GUI)服务器上制作并发布一个种子呢? mktorrent 就是这样一个可以让我们使用命令行的方式来制作种子的工具。

0. 安装

// 0. 首先下载 mktorrent
$ sudo wget https://github.com/Rudde/mktorrent/archive/master.zip

// 1. 解压
$ sudo unzip master.zip 
$ cd mktorrent-master

// 2. 编译安装
$ sudo make
$ sudo make install

到这里就安装好了,可执行文件在 /usr/local/bin/mktorrent

1. 制作种子

$ mktorrent -h

mktorrent 1.1 (c) 2007, 2009 Emil Renner Berthing

Usage: mktorrent [OPTIONS] <target directory or filename>

Options:
-a <url>[,<url>]* : specify the full announce URLs
                    at least one is required
                    additional -a adds backup trackers
-c <comment>      : add a comment to the metainfo
-d                : don't write the creation date
-h                : show this help screen
-l <n>            : set the piece length to 2^n bytes,
                    default is 18, that is 2^18 = 256kb
-n <name>         : set the name of the torrent,
                    default is the basename of the target
-o <filename>     : set the path and filename of the created file
                    default is <name>.torrent
-p                : set the private flag
-s                : add source string embedded in infohash
-v                : be verbose
-w <url>[,<url>]* : add web seed URLs
                    additional -w adds more URLs

Please send bug reports, patches, feature requests, praise and
general gossip about the program to: mktorrent@rudde.org
  • -a 我们要发布种子的Tracker URL
  • -c 给种子一个简短的描述信息
  • -d 不写入创建时间
  • -l 文件分段大小. 例如 -l 19 就是 512KiB大小
  • -n 待生成的种子名字. 默认为文件或文件夹名字
  • -o 待生成的种子路径及名字
  • -p 声明该种子是私人的. Private Tracker
  • -s 嵌入一段字符串到种子hash
  • -v 输出详细信息

介绍完了,我们来生成一个种子吧 假定我们待生成种子的是一个叫 demo 的文件夹, 生成的种子文件叫 demo.torrent, 发布到BYR

mktorrent -v -p -l 19 -a https://tracker.byr.cn/announce.php -o demo.torrent demo

到这里我们就完成了种子的制作。

2. 发布种子&做种

以客户端Deluge发布到BYR为例

首先需要在BYR进行种子的上传,上传成功后会自动下载一个新种子,在再Deluge的Web端Add新种子。

需要注意的是: 1. 需要事先把上一步的demo文件夹复制或移动到Deluge配置的下载目录 2. 需要demo文件夹的读写权限与Deluge配置的下载目录的其他文件及文件夹权限一致,且所有人一致

Add之后就完成了发布种子和做种

THE END
分享
二维码
< <上一篇
下一篇>>