New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

rTorrent on BUBBA

How are you using your Bubba? Got ideas for a cool modification? Share!
Locked
nb000
Posts: 20
Joined: 29 May 2008, 14:40

rTorrent on BUBBA

Post by nb000 »

Hi all,

in the following post I will describe how to install rTorrent on bubba.

rTorrent is written in C++ and has a CLI interface.
(text mode interface, see screenshots at progs homepage)

We will also need GNU screen for being able to run it,
when we log out of the SSH (secure shell).

This bittorrent client is more for linux nerds, :twisted:
than for the average users :!:
nb000
Posts: 20
Joined: 29 May 2008, 14:40

Post by nb000 »

screen will allow us 2 important things:
-be able to run rtorrent, when we leave ssh
-run more terminals in one console (useful for putty)

Installing screen:
  1. be root (su)
  2. apt-get install screen
  3. done :wink:
using screen:
- to start a screen just enter:

Code: Select all

screen
- to see the list of runnging screens:

Code: Select all

screen -ls
- to attach a running screen to the consol:

Code: Select all

screen -R
screen key commands:
The following key-combinations can be used, when a screen is running, and is attached to the consol.
All key kombinations begin with pressing control and a simultaniusly.

Code: Select all

ctrl+a " - list the of terminals
ctrl+a c - create a new terminal
ctrl+a A - set the name of the current terminal
ctrl+a n - switch to next terminal
ctrl+a p - switch to prev terminal
ctrl+a d - detach the screen, and let it run without user interface
further reading:
gentoo screen wiki
nb000
Posts: 20
Joined: 29 May 2008, 14:40

installing rTorrent

Post by nb000 »

After we installed screen, we ready to install rTorrent.

It is very easy, just enter the command (as root):
apt-get install rtorrent
NOTE: the latest version can not be installed using apt-get right now.
  1. Now you need to will need a configuration file.
    You can download it from: here.
  2. Copy it to you home folder (/home/username/).
  3. Create a 'session' folder for storing the session and torrent files.
  4. Create a 'download' folder for obvius reasons. 8)
  5. Now we have to edit the config file a bit:
    (edit for example with nano: nano .rtorrent.rc)
  6. uncomment the line (remove the hashmark)
    #directory = ./
    and change it to
    directory = ./download
  7. uncomment the line (remove the hashmark)
    #session = ./session
  8. NOTE: you may set olny one port to be used
    with the port_range option
    in the form: 2222-2222
  9. NOTE: dht and peer_exchange DO NOT work yet. (version 0.7.4)
    Do not uncomment them, or rtorrent won't start.
Install is now done, rtorrent is ready to start.
nb000
Posts: 20
Joined: 29 May 2008, 14:40

using rtorrent trough screen

Post by nb000 »

Now let's get to the intresting part.
Using rTorrent with screen.

1st time start of rtorrent
- log in to BUBBA trough SSH. (using putty or ssh)
- start screen (just enter screen and hit enter)
- go to your home dir (cd ~)
- start rTorrent (enter rtorrent and hit enter)
- for adding torrents see the section below
- detach screen (hit ctrl+a and then d)
- log out of BUBBA (enter the command: exit)

adding torrents for download
- to do this you must be logged into BUBBA,
- the screen must be reattached (screen -R),
- and you must see the rtorrent interface
- now we are ready to add a torrent file for downloading
- there are 2 ways of doing this:
* 1. add and start: hit backspace and enter torrent filename
* 2. add only: hit enter and enter torrent filename
- in both cases you can use tab for auto-complete
- if you only added the torrent file, you can start it with ctrl+s
or you can run a hash check on it with ctrl+r
- you can stop a running torrent with ctrl+d
be warned: on stopped torrents ctrl+d removes the torrent
- you can not leave the program using ctrl+a d (detach screen)
- and can leave BUBBA with exit

checking rtorrent status
- log in to BUBBA
- attach screen (screen -R)
- now you see the rTorrent interface
- leave by detaching the screen and logging out of BUBBA

Further reading:
rTorrent - UserGuide
nb000
Posts: 20
Joined: 29 May 2008, 14:40

screenshots

Post by nb000 »

the main view of rTorrent with 6 torrents (showed in putty): NOTE: 3 torrent titles are pixelised :twisted:
Image


NOTE on PuTTY:
putty can be downloaded from:
putty's official site (download page)
nb000
Posts: 20
Joined: 29 May 2008, 14:40

help wanted

Post by nb000 »

Hi folks!

I tried to install the latest version of rtorrent from its source.
But I'm stuck at configuring rtorrent.
Can someone help?
When running "./configure --with-xmlrpc-c", I get the following error:

Code: Select all

Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
I'm a step further now :-)
curl, libcurl3 and libcurl3-dev installed...
What now?
Last edited by nb000 on 04 Jun 2008, 10:01, edited 2 times in total.
carl
Posts: 474
Joined: 07 May 2008, 04:41

Re: help wanted

Post by carl »

It says it's missing libcurl, which is not curses. (curl is a file transfer library), try installing libcurl3 and it's dev package.

/Carl
nb000 wrote:Hi folks!

I tried to install the latest version of rtorrent from its source.
But I'm stuck at configuring rtorrent.
Can someone help?
When running "./configure --with-xmlrpc-c", I get the following error:

Code: Select all

checking for STUFF... configure: error: Package requirements (sigc++-2.0 libcurl >= 7.12.0 libtorrent >= 0.11.8) were not met:

Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables STUFF_CFLAGS
and STUFF_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
My problem is, that I have both ncurses and it's dev package installed,
see below:

Code: Select all

...$ aptitude search ncurses
p   evms-ncurses                    - Enterprise Volume Management System (ncur
v   libncurses-dev                  -                                          
p   libncurses-ruby                 - ruby Extension for the ncurses C library 
p   libncurses-ruby1.8              - ruby Extension for the ncurses C library 
p   libncurses4                     - Shared libraries for terminal handling   
i   libncurses5                     - Shared libraries for terminal handling   
p   libncurses5-dbg                 - Debugging/profiling libraries for ncurses
i   libncurses5-dev                 - Developer's libraries and docs for ncurse
i A libncursesw5                    - Shared libraries for terminal handling (w
p   libncursesw5-dbg                - Debugging/profiling libraries for ncurses
p   libncursesw5-dev                - Developer's libraries for ncursesw       
v   ncurses                         -                                          
i   ncurses-base                    - Descriptions of common terminal types    
i   ncurses-bin                     - Terminal-related programs and man pages  
v   ncurses-dev                     -                                          
v   ncurses-developer               -                                          
p   ncurses-hexedit                 - Edit files/disks in hex, ASCII and EBCDIC
v   ncurses-runtime                 -                                          
p   ncurses-term                    - Additional terminal type definitions     
Any suggestions?
/Carl Fürstenberg, Excito Software Developer
http://www.excito.com
support@excito.com
nb000
Posts: 20
Joined: 29 May 2008, 14:40

installing rtorrent from sources

Post by nb000 »

Installing rTorrent from the source.
This has 2 big advantages and one disandvantage:
+ you can install the latest version
+ you can manage it from anywhere using nTorrent or n2hell or ...
- you can compile it only on etch :-(

before installing the new version
-Note that it is not as simple as run 3 times the configure,make,make install commands.
-Do NOT compile with gcc 4.1 or later, it won't work. Use gcc 3.4!
-I needed to do the following: (no, I don't remember why)

Code: Select all

sudo nano /etc/ld.so.conf
add the line:
/usr/local/lib
run sudo ldconfig
ntorrent source install stepps:
1. install compilers and co
1.1 sudo aptitude install ...
* make
* gcc-3.4
* g++-3.4
* pkg-config
* libssl-dev
* libsigc++-2.0-dev
* libncurses-dev
* libcurl3
* libcurl3-dev
* libapache2-mod-scgi
* python-scgi
NOTE: libsigc++-dev is not equal to libsigc++-2.0-dev
1.2 run: export CXX=g++-3.4 (if you have a newer gcc installed too)
2. install xmlrpc-c
2.1 download xmlrpc-c sources from here
2.2 unpack source
2.3 go to source dir
2.4 ./configure
2.5 make
2.6 make install
3. install libtorrent
3.1 download the ntorrent and libtorrent sources
3.2 unpack the sources (u can use mc)
3.3 go into extracted source dir of libtorrent
3.4 ./configure
3.5 make
3.6 make install
4. install rtorrent
4.1 cd to rtorrent source dir
4.3 ./configure --with-xmlrpc-c
4.4 make
4.5 make check
4.6 make install
5. set new settings for apache and rtorrent
5.1 add the following line to httpd.conf:
SCGIMount /RPC2 127.0.0.1:5000
5.1 add the following line to rtorrent.rc:
scgi_port = 127.0.0.1:5000
NOTE: you may change the port, but it is not advised
5.2 setup scgi modul
add the following line to apache2.conf:
LoadModule scgi_module modules/mod_scgi.so
or enable the scgi module by creating a soft link in the mods-enabled dir.
5.3 restart apache
sudo /etc/init.d/apache2 restart
6. test xmlrpc-c:
xmlrpc localhost system.listMethods
(you should see a long list of available methods)

If all went ok, then no you can start you new rtorrent.
You should see a message, similar to this:

Code: Select all

(19:00:10) Using 'epoll' based polling.
(19:00:10) XMLRPC initialized with 389 functions.
(19:00:10) The SCGI socket is bound to a specific network device yet may still p
If something does not work (during compiling), then read these:
* rTorrent - xmlrpc guide
* libtorrent ticket 915
* libtorrent ticket 840

Note: I spent several days on compiling, installing and writing this guide.
If something does not work, do not wonder; this is SPARTA :!: (or linux)
Clive
Posts: 164
Joined: 07 Mar 2007, 07:15

Re: installing rtorrent from sources

Post by Clive »

[quote="nb000"]Installing rTorrent from the source.
This has 2 big advantages and one disandvantage:
+ you can install the latest version
+ you can manage it from anywhere using nTorrent or n2hell or ...
- you can compile it only on etch :-(
[quote]

Why would you want to install it from source ?? I use rtorrent on Bubba Sarge and I just installed it, straight from the repositories... Works fine, I only did this because my favorite, private, Bittorent site bans whatver library is reported by the ftd client.... (to be able to change the reported client would be a good extra in the ftd.ini file :wink: )
nb000
Posts: 20
Joined: 29 May 2008, 14:40

Post by nb000 »

Why would you want to install it from source ?? I use rtorrent on Bubba Sarge and I just installed it, straight from the repositories... Works fine
Could you install a version with xmlrpc support using apt-get?
I don't think so. (u can only install 0.6.4-1 using apt)
Without xmlrpc support you cannot manage rtorrent remotly using a gui.
nb000
Posts: 20
Joined: 29 May 2008, 14:40

rTWi

Post by nb000 »

accessing rTorrent trough rTWi

rTWi stands for rTorrent Web interface
It uses php and xmlrpc, to get infor from rTorrent.
You will need the following to get it to work:

Installing prerequirements:
apt-get install ibxslt1.1 php5-curl php5-xmlrpc php5-xsl

Setting up rTWi:
You will need version 0.2.2.
Download it (from rtwi site or direct link).
Extract it to a dir in you www root (in this example I will use rtwi).
Rename index.html to index.php
nano /var/www/rtwi/includes/config.inc.php
Enter your base url in the $url["base"] line.
Change "input.html" to "input.php" in the $url["input"] line.
Change the 1st user to your linux username and password's sha1 hash.
(an online hash generator can be found here or here)
(the port number should be the same as in .rtorrent.rc)
Change dht to false in the line: $config["allow"]["dht"] = true;
Save the file (by hitting ctrl+o and enter).
Edit the index.php file, and comment the "get_dht_port" string
in the $xmlrpc_methods array. (put it into /* here */)
You can hide the stats, that appears at the page bottom,
by commenting the printf commands at the end of the file.

Checking if everything worked:
start a browser on your PC and go to <yourhostname>/rtwi
enter your username and password at login, and prey :twisted:
If everything is fine, then you will see your running torrents.
You can also add new torrents and see server info.

Language of the interface:
The program has only english and hungarian interface,
I use the later one.
You can get other translations from later versions if rTWi,
or add a translation in the includes dir by translating the english file.
The language can be set in config.inc.php.

Screenshots:
1. the list of torrents
Image
2. the server info page
Image
nb000
Posts: 20
Joined: 29 May 2008, 14:40

rTorrent 0.8.6 / libtorrent 0.12.6 on BUBBA

Post by nb000 »

Installing this version from source is almost the same, but there are some minor differences.

You have to update the two packages below before compiling:
c-ares (min version 1.5.3) download URL
curl (min version 7.19.2) download URL
./configure --enable-ares
For details see this rtorrent bug report.

Before compiling the libtorrent sources, you have to alter the file:
/usr/share/aclocal/libmcrypt.m4
in the 17th line, you have to surround the text AM_PATH_LIBMCRYPT with brackets,
so it becomes [AM_PATH_LIBMCRYPT].

After installing rtorrent you have to run the following command (again):

Code: Select all

sudo ldconfig
This is after you edited the /etc/ld.so.conf file.
matkr265
Posts: 16
Joined: 26 Sep 2008, 02:23

Re: rTorrent 0.8.6 / libtorrent 0.12.6 on BUBBA

Post by matkr265 »

Hello nb000

Great post abut installing rtorrent 0.8.6 (my tracker no longer accepts 0.7.9-2), but I ran into a problem during the installation of libcurl3 that I hope you can shed some light on. Aptitude wants me to downgrade rtorrent, libcurl and libxmlrpc-c3, se the shell printout below, and that feels wrong to me.

Code: Select all

BUBBA:/home/matias# aptitude install libcurl3-dev
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
The following packages are BROKEN:
  libcurl3-openssl-dev
The following NEW packages will be automatically installed:
  comerr-dev libidn11-dev libkadm55 libkrb5-dev
The following NEW packages will be installed:
  comerr-dev libcurl3-dev libidn11-dev libkadm55 libkrb5-dev
0 packages upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 2337kB of archives. After unpacking 6509kB will be used.
The following packages have unmet dependencies:
  libcurl3-openssl-dev: Depends: libcurl3 (= 7.15.5-1etch1) but 7.18.2-5 is installed.
Resolving dependencies...
The following actions will resolve these dependencies:

Install the following packages:
libtorrent9 [0.10.4-1 (oldstable)]
libwww0 [5.4.0-11 (oldstable)]

Downgrade the following packages:
libcurl3 [7.18.2-5 (stable, now) -> 7.15.5-1etch1 (upstream_stable)]
libxmlrpc-c3 [1.06.27-1 (stable, now) -> 0.9.10-4 (oldstable)]
rtorrent [0.7.9-2 (stable, now) -> 0.6.4-1 (oldstable)]

Score is -360

Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.
BUBBA:/home/matias#
Do you have an idea about what I should do?

regards
Matias
matkr265
Posts: 16
Joined: 26 Sep 2008, 02:23

Re: rTorrent 0.8.6 / libtorrent 0.12.6 on BUBBA

Post by matkr265 »

I solved it on "my own", se my solution in another thread:
http://forum.excito.net/viewtopic.php?f=9&t=2557#p12136
regards
matkr265
matkr265 wrote:Hello nb000

Great post abut installing rtorrent 0.8.6 (my tracker no longer accepts 0.7.9-2), but I ran into a problem during the installation of libcurl3 that I hope you can shed some light on. Aptitude wants me to downgrade rtorrent, libcurl and libxmlrpc-c3, se the shell printout below, and that feels wrong to me.

Code: Select all

BUBBA:/home/matias# aptitude install libcurl3-dev
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
The following packages are BROKEN:
  libcurl3-openssl-dev
The following NEW packages will be automatically installed:
  comerr-dev libidn11-dev libkadm55 libkrb5-dev
The following NEW packages will be installed:
  comerr-dev libcurl3-dev libidn11-dev libkadm55 libkrb5-dev
0 packages upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 2337kB of archives. After unpacking 6509kB will be used.
The following packages have unmet dependencies:
  libcurl3-openssl-dev: Depends: libcurl3 (= 7.15.5-1etch1) but 7.18.2-5 is installed.
Resolving dependencies...
The following actions will resolve these dependencies:

Install the following packages:
libtorrent9 [0.10.4-1 (oldstable)]
libwww0 [5.4.0-11 (oldstable)]

Downgrade the following packages:
libcurl3 [7.18.2-5 (stable, now) -> 7.15.5-1etch1 (upstream_stable)]
libxmlrpc-c3 [1.06.27-1 (stable, now) -> 0.9.10-4 (oldstable)]
rtorrent [0.7.9-2 (stable, now) -> 0.6.4-1 (oldstable)]

Score is -360

Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.
BUBBA:/home/matias#
Do you have an idea about what I should do?

regards
Matias
Locked