欢迎光临
我们一直在努力

两种方法在Debian9上安装rTorrent+Flood

在Debian9上安装rTorrent,最简单的方法,一条命令解决问题:

apt -y install rtorrent

不过这样安装的是0.9.6版本,如果要用最新版还是建议自己编译,正好最近rTorrent又更新了,所以水一篇文章。。

现在安装编译所需的全部依赖/软件:

apt -y install build-essential curl git mediainfo supervisor 
automake libcppunit-dev libtool libssl-dev libcurl4-openssl-dev 
libncurses-dev libxmlrpc-c++8-dev pkg-config zlib1g-dev

如果你是使用APT包管理器安装的rTorrent,也别忘了安装一下上面提到的:

build-essential/curl/mediainfo/supervisor

下载libtorrent源码解压/编译/安装:

wget http://rtorrent.net/downloads/libtorrent-0.13.8.tar.gz
tar -xzvf libtorrent-0.13.8.tar.gz
cd libtorrent-0.13.8
./autogen.sh
./configure 
make -j$(nproc)
make install
ldconfig

下载rtorrent源码解压/编译/安装:

wget http://rtorrent.net/downloads/rtorrent-0.9.8.tar.gz
tar -xzvf rtorrent-0.9.8.tar.gz
cd rtorrent-0.9.8
./autogen.sh
./configure --prefix=/usr --with-xmlrpc-c
make -j$(nproc)
make install

新建rTorrent所需的目录:

mkdir -p /opt/rtorrent/download && mkdir -p /opt/rtorrent/.session && mkdir -p /opt/rtorrent/.watch

新建rTorrent配置文件:

nano /opt/rtorrent/.rtorrent.rc

写入:

directory ="/opt/rtorrent/download/"
session ="/opt/rtorrent/.session"

### BitTorrent
# Global upload and download rate in KiB, `0` for unlimited
throttle.global_down.max_rate.set = 0
throttle.global_up.max_rate.set = 0

# Maximum number of simultaneous downloads and uploads slots
throttle.max_downloads.global.set = 65000
throttle.max_uploads.global.set = 65000

# Maximum and minimum number of peers to connect to per torrent while downloading
throttle.min_peers.normal.set = 1
throttle.max_peers.normal.set = 51121

# Same as above but for seeding completed torrents (seeds per torrent)
throttle.min_peers.seed.set = -1
throttle.max_peers.seed.set = -1

### Networking
protocol.pex.set = yes
trackers.use_udp.set = yes
dht.mode.set = auto
network.port_range.set = 52368-52388
network.port_random.set = yes

network.scgi.open_port = 127.0.0.1:5000
network.xmlrpc.size_limit.set = 2000000
network.http.ssl_verify_peer.set = 0

network.max_open_files.set = 65000
network.max_open_sockets.set = 4096
network.http.max_open.set = 4096
network.send_buffer.size.set = 512M
network.receive_buffer.size.set = 512M
protocol.encryption.set = allow_incoming,enable_retry,prefer_plaintext

### Memory Settings
pieces.hash.on_completion.set = no
pieces.preload.type.set = 1
pieces.memory.max.set = 4096M

安装NodeJS:

curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt -y install nodejs

拉取Flood项目代码/复制一份配置文件:

cd /opt
git clone https://github.com/Flood-UI/flood.git
cd flood
cp config.template.js config.js

编辑配置文件:

nano config.js

将Flood的监听地址改为外网:

接着安装依赖/构建生产/测试启动:

npm install
npm run build
npm start

如果可以看到类似如下图的界面那么说明一切正常,你现在可以按键盘组合键Ctrl+C退出运行:

现在启动supervisor:

systemctl start supervisor
systemctl enable supervisor

新建一个rTorrent的supervisor配置文件:

nano /etc/supervisor/conf.d/rtorrent.conf

写入:

[program:rtorrent]
priority=1
environment=TERM=xterm,HOME=/opt/rtorrent
command=/usr/bin/rtorrent
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/rtorrent.log

使用supervisor管理rTorrent:

supervisorctl update
supervisorctl start rtorrent
supervisorctl stop rtorrent
supervisorctl status rtorrent

新建一个Flood的supervisor配置文件:

nano /etc/supervisor/conf.d/flood.conf

写入:

[program:flood]
priority=2
directory=/opt/flood
command=/usr/bin/npm start
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/flood.log

使用supervisor管理Flood:

supervisorctl update
supervisorctl start flood
supervisorctl stop flood
supervisorctl status flood

现在访问你的服务器公网IP:3000,应该可以看到如下界面,注册你的账号,填写rTorrent的连接信息:

成功登录后可以在用户接口这里更改界面语言为中文:

测试了下。。可以用没问题:

LALA

我什么都不卖了,告辞!

赞(0)
未经允许不得转载:拆东墙 » 两种方法在Debian9上安装rTorrent+Flood

评论 抢沙发

登录

找回密码

注册