Skip to main content

Руководство пользователя

Установка и настройка OPKG-пакета rTorrent

rTorrent — BitTorrent клиент, написанный на языке C++ для операционных систем Linux, на основе библиотек libTorrent. Легкий и нетребовательный к системным ресурсам BitTorrent-клиент.

Рассмотрим вариант установки торрент-клиента rTorrent из репозитория Entware.

  1. Предварительно нужно подготовить внешний USB-накопитель и установить на него систему пакетов репозитория Entware. Как это сделать, подробно показано в инструкции Установка системы пакетов репозитория Entware на USB-накопитель.

  2. Установите пакет rtorrent-easy-install.

    Для этого выполните команду opkg install rtorrent-easy-install:

    / # opkg install rtorrent-easy-install
    Installing rtorrent-easy-install (0.2-3a) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/rtorrent-easy-install_0.2-3a_mipsel-3.4.ipk
    Installing rutorrent-plugin-rpc (3.8-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/rutorrent-plugin-rpc_3.8-1_mipsel-3.4.ipk
    Installing rutorrent (3.8-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/rutorrent_3.8-1_mipsel-3.4.ipk
    Installing rtorrent-rpc (0.9.7-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/rtorrent-rpc_0.9.7-1_mipsel-3.4.ipk
    Installing libcurl (7.61.0-3) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/libcurl_7.61.0-3_mipsel-3.4.ipk
    Installing libopenssl (1.0.2p-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/libopenssl_1.0.2p-1_mipsel-3.4.ipk
    Installing zlib (1.2.11-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/zlib_1.2.11-2_mipsel-3.4.ipk
    Installing ca-bundle (20180409-3) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/ca-bundle_20180409-3_all.ipk
    Installing libtorrent (0.13.7) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/libtorrent_0.13.7_mipsel-3.4.ipk
    Installing libsigcxx (2.5.4-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/libsigcxx_2.5.4-1_mipsel-3.4.ipk
    Installing libncursesw (6.1-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/libncursesw_6.1-1_mipsel-3.4.ipk
    Installing xmlrpc-c-server (1.39.13-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/xmlrpc-c-server_1.39.13-2_mipsel-3.4.ipk
    Installing xmlrpc-c (1.39.13-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/xmlrpc-c_1.39.13-2_mipsel-3.4.ipk
    Installing xmlrpc-c-internal (1.39.13-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/xmlrpc-c-internal_1.39.13-2_mipsel-3.4.ipk
    Installing xmlrpc-c-common (1.39.13-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/xmlrpc-c-common_1.39.13-2_mipsel-3.4.ipk
    Installing coreutils-stat (8.23-3) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/coreutils-stat_8.23-3_mipsel-3.4.ipk
    Installing coreutils (8.23-3) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/coreutils_8.23-3_mipsel-3.4.ipk
    Installing coreutils-id (8.23-3) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/coreutils-id_8.23-3_mipsel-3.4.ipk
    Installing gzip (1.9-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/gzip_1.9-1_mipsel-3.4.ipk
    Installing curl (7.61.0-3) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/curl_7.61.0-3_mipsel-3.4.ipk
    Installing screen (4.6.2-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/screen_4.6.2-1_mipsel-3.4.ipk
    Installing libncurses (6.1-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/libncurses_6.1-1_mipsel-3.4.ipk
    Installing php7-cgi (7.2.9-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/php7-cgi_7.2.9-1_mipsel-3.4.ipk
    Installing php7 (7.2.9-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/php7_7.2.9-1_mipsel-3.4.ipk
    Installing libxml2 (2.9.8-3) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/libxml2_2.9.8-3_mipsel-3.4.ipk
    Installing lighttpd-mod-fastcgi (1.4.49-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/lighttpd-mod-fastcgi_1.4.49-2_mipsel-3.4.ipk
    Installing lighttpd (1.4.49-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/lighttpd_1.4.49-2_mipsel-3.4.ipk
    Installing lighttpd-mod-scgi (1.4.49-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/lighttpd-mod-scgi_1.4.49-2_mipsel-3.4.ipk
    Installing lighttpd-mod-auth (1.4.49-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/lighttpd-mod-auth_1.4.49-2_mipsel-3.4.ipk
    Installing lighttpd-mod-authn_file (1.4.49-2) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/lighttpd-mod-authn_file_1.4.49-2_mipsel-3.4.ipk
    Configuring zlib.
    Configuring libopenssl.
    Configuring ca-bundle.
    Configuring libcurl.
    Configuring lighttpd.
    Configuring lighttpd-mod-authn_file.
    Configuring xmlrpc-c-common.
    Configuring xmlrpc-c-internal.
    Configuring xmlrpc-c.
    Configuring libxml2.
    Configuring php7.
    Configuring php7-cgi.
    Configuring coreutils.
    Configuring coreutils-stat.
    Configuring libsigcxx.
    Configuring libtorrent.
    Configuring libncursesw.
    Configuring xmlrpc-c-server.
    Configuring rtorrent-rpc.
    Configuring coreutils-id.
    Configuring gzip.
    Configuring curl.
    Configuring rutorrent.
    Configuring rutorrent-plugin-rpc.
    Configuring libncurses.
    Configuring screen.
    Configuring lighttpd-mod-fastcgi.
    Configuring lighttpd-mod-scgi.
    Configuring lighttpd-mod-auth.
    Configuring rtorrent-easy-install.
    
  3. В момент установки пакета сразу будет предложено настроить базовые возможности.

    Можете установить свой логин/пароль, порт, скорость загрузки/отдачи, путь для скачиваемых торрент-файлов:

    Type "username:password" if you want to protect Web UI or hit Enter to leave password protection disabled []: устанавливаем свой логин:пароль, например myhome:mytorrent

    Which port should be used by web interface? [81]: по умолчанию стоит 81 порт, можно установить любой свободный порт

    Enter (maximal) download speed in KB/s [2048]: по умолчанию установлена скорость 2048, можно поставить свое значение

    Enter (maximal) upload speed in KB/s [2048]: по умолчанию установлена скорость 2048, можно поставить свое значение

    Enter folder name on USB drive where torrent content should be stored [/opt/torrents]: указываем путь, куда будут скачиваться торрент-файлы. Лучше устанавливать NTFS-раздел, к примеру у нас создан раздел с файловой системой NTFS, называется FILES, в нем мы создали директорию download, указываем путь: /tmp/mnt/FILES/download

    #### Welcome to rtorrent easy installation script!
    We assuming no lighttpd/rtorrent/rutorrent was installed before!
    Please, answer a few question to configure torrent client.
    Default aswers given in [brackets], just hit Enter to accept it.
    
    Type "username:password" if you want to protect Web UI or hit Enter to leave password protection disabled []: test:test
    Which port should be used by web interface? [81]:
    Enter (maximal) download speed in KB/s [2048]:
    Enter (maximal) upload speed in KB/s [2048]:
    Enter folder name on USB drive where torrent content should be stored [/opt/torrents]:
    
    Done! You may open 51411-51412 TCP/UDP ports on your router to
    facilitate uploading/donwloading. It's not necessary but recommended.
    rutorrent web UI will be available at following URL:
    http://<ip_address_of_router>:<port>/rutorrent
    
    Do you wish to start torrent client? [y]:
    
    Starting lighttpd... done.
    Starting rtorrent... done.
  4. Если демон rtorrent не запустился, вы увидите ошибку:

    Do you wish to start torrent client? [y]: 
     Starting lighttpd... done. 
     Starting rtorrent... failed. 
    Collected errors:
     * pkg_run_script: package "rtorrent-easy-install" postinst script returned status 255.
     * opkg_configure: rtorrent-easy-install.postinst returned 255.
  5. Необходимо будет внести изменения в конфигурацию rtorrent. Для этого нужно будет установить пакет nano и отредактировать файл конфигурации rtorrent.conf

    Устанавливаем пакет nano:

    / # opkg install nano
    Installing nano (2.9.8-1) to root...
    Downloading http://bin.entware.net/mipselsf-k3.4/nano_2.9.8-1_mipsel-3.4.ipk
    Configuring nano.

    Редактируем файл конфигурации rtorrent.conf, в котором удаляем старую конфигурацию:

    / # nano /opt/etc/rtorrent/rtorrent.conf

    Выделяем все строки старого конфига, нажимаем клавиши Alt + A:

    max_uploads = 8
    session = /opt/etc/rtorrent/session
    schedule = watch_directory,5,5,load_start=/opt/etc/rtorrent/watchdir/*.torrent
    schedule = untied_directory,5,5,stop_untied=
    schedule = low_diskspace,5,60,close_low_diskspace=100M
    bind = 0.0.0.0
    port_range = 51411-51411
    check_hash = yes
    #use_udp_trackers = yes
    encryption = allow_incoming,enable_retry,prefer_plaintext
    dht = auto
    dht_port = 51412
    peer_exchange = yes
    scgi_local = /opt/var/rpc.socket
    encoding_list = UTF-8
    max_uploads_global = 32
    max_downloads_global = 64
    download_rate = 2048
    upload_rate = 2048
    directory = /opt/torrents

    Удаляем все строки старого конфига, нажимаем клавиши Ctrl + K.

    Добавляем строки нового конфига, нажимаем клавиши Ctrl + V:

    throttle.max_uploads.set = 8
    session.path.set = /opt/etc/rtorrent/session
    schedule2 = watch_directory,5,5,load_start=/opt/etc/rtorrent/watchdir/*.torrent
    schedule2 = untied_directory,5,5,stop_untied=
    schedule2 = low_diskspace,5,60,close_low_diskspace=100M
    network.bind_address.set = 0.0.0.0
    network.port_range.set = 51411-51411
    pieces.hash.on_completion.set = yes
    trackers.use_udp.set = yes
    protocol.encryption.set = allow_incoming,enable_retry,prefer_plaintext
    dht.mode.set = auto
    dht.port.set = 51412
    protocol.pex.set = yes
    network.scgi.open_local = /opt/var/rpc.socket
    encoding.add = UTF-8
    throttle.max_uploads.global.set = 32
    throttle.max_downloads.global.set = 64
    throttle.global_down.max_rate.set_kb = 0
    throttle.global_up.max_rate.set_kb = 0
    directory.default.set = /opt/torrents

    Нажимаем клавиши Ctrl + O, сохраняем конфигурацию.

    Выходим из редактора nano Ctrl + X.

  6. Запускаем rtorrent:

    / # /opt/etc/init.d/S85rtorrent start
     Starting rtorrent... done.
  7. Заходим в веб-интерфейс rTorrent по адресу http://192.168.1.1:81/rutorrent/, делаем настройку и проверяем работу:

    rtor-opkg-11-en.png
    rtor-opkg-12-en.png

Важно

Поддержка пакета осуществляется в теме форума разработчиков — rTorrent - BitTorrent-клиент.