Installing and Configuring rTorrent on Debian

  • Tutorial
Torrent file iconDebian logorTorrent is one of the most popular torrent clients in the world of Unix-like operating systems ( I already wrote about Transmission a bit earlier). When creating this client, according to the author , “high performance and good code” were at the forefront, and using mmap to display files in memory allows achieving three-fold advantages over official channels on broadband channels . Another feature of rTorrent is the availability of many different web-based interfaces for all tastes for remote control. It is about installing and configuring all this that I want to talk about this time.

RTorrent installation


When installing rTorrent, I will assume that all actions are performed in the latest version of Debian (at the time of writing of article 2010-03-27 this is Debian Lenny ). Often, when using this OS, people choose either a stable branch of repositories or a test one, and they differ in the versions of the packages contained in them. Unfortunately, the rtorrent package version 0.7.9 is in the stable branch while the latest version has already reached the number 0.8.6. In this regard, I will talk about installing the latest version of rTorrent separately for the test one, and separately for the stable repository branches.

Install rTorrent with a stable Debian repository branch


Last time, when describing the installation of the latest version of Transmission , I used source compilation, which rightly caused a storm of indignation and criticism :) This time I will show how to achieve the desired result without resorting to the help of the compiler.

All we need to do is connect the test repository branch and install the latest version of the package from it, but make it so that the whole system (with the exception of our package) remains on a stable branch. You can accomplish this task using the “pinning” mechanism (I don’t know how “pinning” is harmoniously translated into Russian), more about which can be found in the official documentation or, for example, herehere .

To do this, /etc/apt/sources.listadd test repositories to the file :

deb http://ftp.ua.debian.org/debian/ testing main
deb http://security.debian.org/ testing/updates main

I added the Ukrainian mirror, you choose the one that suits you best depending on the geographical location or personal preferences;)

The next step is to create a file /etc/apt/preferencesand set priorities for repositories in it so that packages from a stable branch are selected by default:

Package: *
Pin: release a=stable
Pin-Priority: 700

Package: *
Pin: release a=testing
Pin-Priority: 650

Now you need to update the list of available packages:

# aptitude update

And install the latest available version of rTorrent:

# aptitude -t testing install rtorrent

where -twe explicitly set the " " option to use the test repository to install this package.

Next, go to the rTorrent setup.

Install rTorrent on a Debian repository test branch

Tux
If your system is initially configured to use the test repository branch, then the installation, in your case, comes down to only one command:

# aptitude install rtorrent

After that, you can proceed to the rTorrent configuration.

RTorrent setup


Create a settings file ~/.rtorrent.rcsimilar to this:

# Диапазон рабочих портов torrent клиента.
# Если вы за NAT не забываем "пробросить" порты
port_range = 32001-32049

# Включаем DHT
dht = auto
# UDP порт для DHT
dht_port = 32000
# Обмен пирами
peer_exchange = yes

# Использовать ли UDP трекеры
use_udp_trackers = yes

# Директория в которую по-умолчанию будут загружаться файлы
directory = /arch/.Downloading/

# Глобальные ограничения по скорости
upload_rate = 80
download_rate = 800

# Директория для записи сессий rTorrent
session = /home/username/.rtorrent_session

# Задаем настройки для rpc управления
scgi_port = 127.0.0.1:5000

We create a folder for storing the rTorrent session:

$ mkdir .rtorrent_session

In general, I gave only the basic rTorrent settings. You can read more about the settings of this wonderful torrent client here , here and here .

RTorrent startup setup


In order for rTorrent to start automatically when the machine starts, you need to perform a few simple steps. First, install the screennecessary torrent client in the background:

# aptitude install screen

Then load the start script:

# cd /etc/init.d/
# wget http://libtorrent.rakshasa.no/raw-attachment/wiki/RTorrentCommonTasks/rtorrentInit.sh

Edit the file and specify the username from which rTorrent will be launched:

user="user"

We make the file executable:

# chmod +x rtorrentInit.sh

Set the owner of the system user’s file as root:

# chown root:root rtorrentInit.sh

Turn on “autoload”:

# update-rc.d rtorrentInit.sh defaults

Everything, now the daemon can be launched by executing this command:

# /etc/init.d/rtorrentInit.sh start

Now, during each boot of the machine, our torrent client will automatically start.

web interfaces

konqueror
For the operation of web-interfaces, as you probably already guessed, a web-server is required. It can be both Apache and Lighttpd , and, quite possibly, some other one. However, for definiteness, I will consider all Apache-based examples. If you do not have a web server installed, then the next item is for you; otherwise, you just wave through it.

Apache installation


To install Apache, you need to run a few simple commands. Let's start by installing the web server itself and the module necessary for remote control of rTorrent scgi:

# aptitude install apache2 libapache2-mod-scgi

Set the module settings in the file /etc/apache2/httpd.conf:

SCGIMount /RPC2 127.0.0.1:5000

and turn it on:

# a2enmod scgi

Next, install PHP:

# aptitude install php5 php5-common libapache2-mod-php5 php5-curl

and restart Apache:

# apache2ctl restart

After installing Apache, we will go on to consider the various web interfaces to rTorrent.

wTorrent


WTorrent requires a database for its work sqlite. Install it: Now download directly wTorrent itself: # cd / var / www / # svn co svn: //wtorrent-project.org/repos/trunk/wtorrent/ Set permissions for the web server: Next, we direct the browser to the address and configure similar to this screenshot: ( Click to enlarge ) Be sure to delete the file for security purposes : Now you can evaluate the result by going to : ( Click to enlarge )

# aptitude install sqlite3 php5-sqlite
# apache2ctl restart









# chown -R www-data:www-data ./wtorrent/

http://<ваш IP адрес>/wtorrent/install.php

wtorrent install


install.php

# rm wtorrent/install.php

http://<ваш IP адрес>/wtorrent/

image


ruTorrent


To configure ruTorrent, download the latest version from SVN: And set the access rights for the web server: Now, to open the newly installed ruTorrent, you need to send a browser to the address . And here is what it looks like: ( Click to enlarge ) ( Click to enlarge ) I also can not help but note that under ruTorrent there are many useful plugins that significantly expand the standard features. So, with the help of plugins you can implement the processing of RSS feeds , traffic accounting , speed limits on a schedule and much more. A complete list of plugins is here.

# cd /var/www/
# svn checkout http://rutorrent.googlecode.com/svn/trunk/rutorrent




# chown -R www-data:www-data ./rutorrent/

http://<ваш IP адрес>/rutorrent/

ruTorrent


ruTorrent


. I will show the installation process of the plugin using the Tracklabels example , which will automatically add tags depending on the download tracker. In this case, all other plugins are added in the same way. And you can look at the result of installing the plugin immediately after updating the page in the browser: ( Click to enlarge ) And one more, well, just delightful idea flashed ruTorrent. Namely, the beginnings of multi-user work appear in it, where each person has their own instance of a torrent client attached with their own settings and restrictions that are not dependent on anything (for example, speed). You can read more about this at the following link: forums.rutorrent.org/index.php?topic=87.0

# cd /var/www/rutorrent/plugins/
# svn checkout rutorrent.googlecode.com/svn/trunk/plugins/tracklabels
# chown -R www-data:www-data /var/www/rutorrent/plugins/




image





Other web-based interfaces and programs for remote control


On the web interfaces I described, the list does not end at all. They are not so little created and developed. A list of the most popular can be found on rTorretn's official website: libtorrent.rakshasa.no/wiki/UtilsList

And again about download automation


Do not forget again and again you will be reminded of such a convenient thing as automating the downloads of your favorite series from RSS feeds of various trackers. And despite the fact that the web interfaces described above either have built-in tools for processing RSS feeds (wTorrent), or are expanded by the corresponding plug-ins (ruTorrent), these tools, unfortunately, are not always enough. In more detail below:
  • I already wrote on this topic here right here (on the example of LostFilm 'a) and here (on the example of the Cinema Hall ). Both solutions are implemented in the form of shell commands and is based on grep, wget, curl,

  • Also, another way to automate through FlexGet described Alukar 's here ;

  • And another option for processing RSS feeds using Yahoo Pipes was considered by the amoN haberman in this post.
Just assistants in this matter may be the following two wonderful service, already described Habré: tvfodor and Kinobaza.tv .

RTorrent tuning under heavy loads


About finer rTorrent settings under heavy loads can be read both on the official website and in user comments:

% username%, but how did you get your rTorrent config up?

UPD . Added a section on rTorrent tuning under heavy loads.

Also popular now: