How To: SVN rtorrent + wtorrent (rtorrent WebUI)

courtesy of lighthouse.

Below is a how-to which I have just used to install rTorrent from source - and then use wtorrent (web UI) for rTorrent.

Urls:

rTorrent is an ncurses client which leverages libtorrent as it’s BitTorrent library:

http://libtorrent.rakshasa.no/

wTorrent is a php/xhtml web interface for rTorrent:

http://canbruixa.homelinux.net/wt/

For screens of wTorrent please see the website - it’s very pretty.

Notes:

- there are a few web uis available for rtorrent - I’ve tried them all and personally like wtorrent the best.

- this tutorial was done on a Debian box, other flavours of nix may act differently.

- i take no responsibility for any security issues - i’m showing you how i installed it - this may not be fool proof.

Step 1 - ensure required packages are installed:

sudo apt-get install subversion build-essential libtool automake1.9 openssl libcurl3 libcurl3-dev
libsigc++-2.0-0c2a libsigc++-2.0-dev libncurses5 libncurses5-dev

Step 2 - Installing Xmlrpc-c

##note - unsure if this is actually required but to be honest it’s not that hard so do it anyway!

wget http://ovh.dl.sourceforge.net/sourceforge/xmlrpc-c/xmlrpc-1.06.23.tgz

tar zxfv xmlrpc-1.06.23.tgz

cd xmlrpc-1.06.23

./configure && make && make install

Step 3 - libtorrent / rtorrent

mkdir rtorrent-svn
cd rtorrent-svn
svn co svn://rakshasa.no/libtorrent/trunk
svn up
cd trunk
cd libtorrent
./autogen.sh
./configure
make
make install
cd ../rtorrent
./autogen.sh
./configure –with-xmlrpc-c
make
make install

##note the importance of the –with-xmlrpc-c in the ./configure line above:

( double-dash before ‘with’ -> " - - with - xmlrpc-c " )

Step 4 - rtorrent config file

Most important - addition of:

scgi_port = localhost:5000

Step 5 - Start rtorrent

as the user you want, under the conditions you want - start rtorrent:

‘rtorrent’

Step 6 - Configuring a http server- including mod_scgi

note: This is where i get the lazy’s - you really should compile a http server according to your preferences. I use lampp because it rocks - I’ve outlined how i did it below.

– Lampp is an apache based and required the addition of mod_scgi done by:

## notes: dependancy for this is the -dev package for lampp.

edit: i’ve added steps required to install lampp:

wget http://www.apachefriends.org/download.php?xampp-linux-1.6.5a.tar.gz
tar xvfz xampp-linux-1.6.5a.tar.gz -C /opt
http://www.apachefriends.org/download.php?xampp-linux-devel-1.6.5a.tar.gz
tar xvfz xampp-linux-devel-1.6.5a.tar.gz -C /opt

to start xampp - /opt/lampp/lampp start

to FIX security -  /opt/lampp/lampp security

…. goto the website if you wanna know more… www.apachefriends.org

wget http://quixote.python.ca/releases/scgi-1.12.tar.gz
tar zxfv scgi-1.12.tar.gz
cd scgi-1.12
cd apache2
/opt/lampp/bin/apxs -i -c mod_scgi.c
cd /opt/lampp/etc
nano httpd.conf
 # http.conf edit #1: Find the other LoadModule lines and add:

LoadModule scgi_module modules/mod_scgi.so

# httpd.conf edit #2: Goto the end of the file and add:

SCGIMount /RPC2 127.0.0.1:5000

after these edits httpd (or all of llampp must be restarted, reload would probably work but im lazy) - /opt/lampp/lampp restart

[b]Step 7 - wtorrent configuration.

##notes: some of these steps are specific to my installation.

cd /opt/lampp/htdocs
wget http://canbruixa.homelinux.net/wt/rel/wtorrent-current.tar.gz
tar zxfv wtorrent-current.tar.gz

Step 8 - edit the config

according to your setup and preferences - its easy..

cd wtorrent/conf
cp sample.home.conf.php home.conf.php
nano home.conf.php

## notes: Make your torrents, database and smarty compile dirs (default torrents/, db/ and tpl_c/) writable by your web server user.

navigate to install.php and make yourself a username / password - do this once. then move install.php for safekeeping

http://domain.tld/wtorrent/install.php (obviously change this according to your setup..)

once complete navigate to http://domain.tld/wtorrent/index.php and enter your credentials..

Step 9 - Add a private tracker to the wtorrent feeds

add your passkey and add to the wtorrent feed:

http://rss.torrentleech.org/rss.php?passkey=<your passkey here>

Be sure to use the ‘Direct Download’ feed, if possible (not shown in the above example).

We’re done!

EXTRAS:

Here’s an alternative tutorial:

http://flipsidereality.com/blog/linux/rtorrent-with-wtorrent-on-debian-etch-complete-howto/

Here’s an alternative program:

http://www.thewulong.com/w3btorrent/

Question: How can I make rTorrent automatically extract RAR files when they have been downloaded? And if I could make rTorrent stop seeding the torrent and delete its RAR files after X days, that would be great. Any idea how?

A: You can schedule/execute stuff from rTorrent, read the manual multiple times, at some point it should come to you. If I’m not mistaken, the unrar thing would look like:

on_finished = unrar_on_completion,"execute=unrar,e,$d.get_base_path=,*"

This link may help with rTorrent tasks:

http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks