PDA

Bekijk de volledige versie : [How to] rtorrent & ntorrent



mancub
23-12-2007, 21:44
I figured I'd try to write a brief how to on getting the rtorrent/ntorrent working together since I've went through it recently in desperation (my Transmission is acting up and downloading really slow, with only half a dozen peers per torrent and no obvious problems to fix).

This is meant for those who wish to run an alternative BT (rtorrent) and do not mind using a client side interface (ntorrent) on their desktop to manage their torrents.

ntorrent (http://code.google.com/p/ntorrent/) is a Java based application and will work on any platform supporting Java >= 1.6. Go to its page and download the binary package to your desktop, it's in the featured downloads (bz2 file and any language addition you need).

Anyways, this might not be exactly step-by-step since I'm recollecting my journey and I might miss a step so please pitch in with your comments.

Oh, if you mess up your router I am not responsible - you have been warned!

I will assume that everyone has a similar setup, WL500gP, /opt and oleg's firmware/feeds.

First of all make sure you got everything up to date:


ipkg update
ipkg upgrade

Then we need to grab rtorrent, it will also install libtorrent and bunch of other things (xmlrpc etc) but no worries you need those as well :)


ipkg install rtorrent

We'll need to run apache or lighttpd to have scgi, so let's install the later:


ipkg install lighttpd

Also, we need screen:


ipkg install screen

...and bash


ipkg install bash

Now we are ready to do some configurating, first lighttpd, the config file for it is in /opt/etc/lighttpd/lighttpd.conf so edit it:


vi /opt/etc/lighttpd/lighttpd.conf

I have kept most things default, you may change the port from default 8081 to something else if you like.
I didn't, what I added was mod_scgi in the server.modules list (I added around the end, you can add anywhere as long as it's not commented):


# "mod_rrdtool",
"mod_scgi",
"mod_accesslog" )


At the very end of the file I've added the following:


scgi.server = (
"/RPC2" =>
( "127.0.0.1" =>
(
"socket" => "/opt/var/run/rpc.socket",
"check-local" => "disable",
"disable-time" => 0, # don't disable scgi if connection fails
)
)
)


This will enable passing the socket connection from rtorrent via lighttpd to our remote ntorrent client via http:// protocol.

Save and exit the file.

Let's make rtorrent config file next, I will use a non default location for it (it usually sits in your home dir as .rtorrent.rc but I want it on my mounted drive):


vi /opt/etc/rtorrent.conf

And these are some of the settings, you can adjust more settings by reading the rtorrent manpage (http://libtorrent.rakshasa.no/rtorrent/rtorrent.1.html)


scgi_local = /opt/var/run/rpc.socket
session = /opt/share/torrent/work
port_range = 10000-11000
directory = /opt/share/torrent/dl
check_hash = yes
encryption = prefer_plaintext
stop_on_ratio = 100
upload_rate = 50
max_uploads = 5


I have used ports 10000-11000 for it, but you can use any port range you like. Remember that you will have to open these ports in your firewall, so...


vi /usr/local/sbin/post-firewall

This is what you should have, at least:


#!/bin/sh

## FIREWALL
## set default policy
iptables -P INPUT DROP
## deny ftp access from WAN
iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 21 -j DROP
## Allow access to various router services from WAN
## open 10000-11000 for rtorrent
for P in 10000:11000; do
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT
done


You might wanna change your pre-shutdown as well, I used the one wirespot posted (thanks!).


vi /usr/local/sbin/pre-shutdown

...and add the following:


#!/bin/sh
# This one is simple. I send signal INT to rtorrent
# to tell it to do a graceful shutdown that will make
# it save its hashes and full status. (You need to
# enable sessions with session=dir in rtorrent.rc
# for this to work!):
/bin/kill -INT $(/bin/pidof rtorrent) &
# Then I wait for 10 seconds to be sure it died
# gracefully. The rtorrent docs say it dies in 5,
# I just wanna make extra sure.
/bin/sleep 10

Since we made the change to flashfs this needs to "stick" after reboot so:


flashfs save && flashfs commit

mancub
23-12-2007, 21:46
Next let's look at the script that starts rtorrent:


vi /opt/etc/init.d/S99rtorrent

I had to change it because I did not use su, my user already has root privileges so I'm pasting the entire script without comments, so replace what you have with code below:


#!/opt/bin/bash
# Do not proceed unless some apps are available.
test -x /opt/bin/screen || exit 0

##Start Configuration##

# the full path to the filename where you store your rtorrent configuration
config=("/opt/etc/rtorrent.conf")

# set of options to run with each instance, separated by a new line
options=("-n -o import=/opt/etc/rtorrent.conf")

# default directory for screen, needs to be an absolute path
base="/opt/share/torrent"

# name of screen session
srnname="rtorrent"
#######################
PATH=/opt/local/bin:/opt/sbin:/opt/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="rtorrent"
NAME=rtorrent
DAEMON=/opt/bin/$NAME
SCRIPTNAME=/opt/etc/init.d/S99rtorrent

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

checkcnfg() {
for (( i=0 ; i < ${#config[@]} ; i++ )) ; do
if ! [ -r "${config[i]}" ] ; then
echo "cannot find readable config ${config[i]}. check that it is there and permissions are appropriate">&2
exit 3
fi
session=$(cat "${config[i]}" | grep "^[[:space:]]*session" | sed "s/^[[:space:]]*session[[:space:]]*=[[:space:]]*//")
if ! [ -d "${session}" ] ; then
echo "cannot find readable session directory ${session} from config ${config[i]}. check permissions">&2
exit 3
fi
done
}

d_start() {
logger "Starting."
[ -d "${base}" ] && cd "${base}"
stty stop undef && stty start undef
screen -ls | grep .${srnname}[[:space:]] > /dev/null || screen -dm -S ${srnname}
for (( i=0 ; i < ${#options[@]} ; i++ )) ; do
sleep 3
screen -S ${srnname} -X screen rtorrent ${options[i]}
done
}
d_stop() {
for (( i=0 ; i < ${#config[@]} ; i++ )) ; do
session=$(cat "${config[i]}" | grep "^[[:space:]]*session" | sed "s/^[[:space:]]*session[[:space:]]*=[[:space:]]*//")
pid=$(cat ${session}/rtorrent.lock | awk -F: '{print($2)}' | sed "s/[^0-9]//g")
# make sure the pid doesn't belong to another process
# skip the pid otherwise
if ps | grep ${pid}.*rtorrent > /dev/null ; then
kill -s INT ${pid}
fi
done
}

checkcnfg

case "$1" in
start)
echo -n "Starting $DESC: $NAME"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
d_stop
echo "."
;;
restart|force-reload)
echo -n "Restarting $DESC: $NAME"
d_stop
sleep 1
d_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0


Hmm, so I guess that's it, let's reboot to make sure everything starts on its own, firewall applies new rules etc...

mancub
23-12-2007, 21:46
After reboot, do ps and you should see lighttpd running as well as screen with your rtorrent attached to it including the -n -o import=...rtorrent.conf.

Now, go to your browser and connect to the lighttpd:


http://routerIP:8081

You should see "lighttpd server is running." Excellent!

Next connect to the socket interface:


http://routerIP:8081/RPC2

You should see an empty screen (as in white...) but that's good. Otherwise if you get 500 Server error, then something is wrong. Either rtorrent isn't running, or lighttpd isn't passing RPC through the socket. Hard to say, you will have to troubleshoot it...

We are ready to connect to our rtorrent now. Unpack the downloaded ntorrent binary somewhere (C:\Program Files\ntorrent, /Applications/ntorrent, /opt/ntorrent ...) and run it. The *ix users can use .sh file included, Winblows users should double-click on the .jar file.

You will see a Profiles dialogue, select http from the protocol drop-down.

Under host enter the IP of your router.

Connection port is 8081 (default for lighttpd or whatever else you set it to).

Mountpoint is /RPC2 (remember that's what we told lighttpd to use as an interface between the rtorrent socket and the Web).

Username is your user on the router, and Password is its password.

Tick "Remember Password" and click "Save profile".

In a moment you should be connected. Look at the bottom of the ntorrent window, there are some numbers there. You should see the Port: 10000-11000 (range we have set earlier), and your Ping: 2 sec or so...zomg it worked, you lucky, you !

So, "File/Add torrent" and off you go, it's pretty simple to use - you'll figure it out on your own.

Happy Holidays!

P.S. This is how I've done it (to best of my knowledge/recollection) so if you run into trouble you are on your own...

polde
24-12-2007, 11:04
Hello,

What can i say it is relay great tutorial for rtorret and ntorrent.

I LIKE IT

and yeah UPLOAD IS WORKING NORMAL now. With transmission i have big problems 0 upload 200 download :S so my ratio was f...... up :)

THX m8

al37919
24-12-2007, 13:34
Why not use:

iptables -I INPUT 1 -p tcp --syn -i "$1" --dport 10000:11000 -j ACCEPT
instead of:

for P in 10000:11000; do
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT
done

Finally, are you sure that rtorrent needs that much ports to be opened? I guess the default value is something like 4-10 ports.

Actually I suggest the following rework of the minimalistic post-firewall file:


#! /bin/sh

## FIREWALL
## set default policy
iptables -P INPUT DROP
# remove last default rule
iptables -D INPUT -j DROP

## Allow access to various router services from WAN
## open 10000-11000 for rtorrent
iptables -A INPUT -p tcp --syn -i "$1" --dport 10000:11000 -j ACCEPT

This allows painless addition of the new rules in the end of the INPUT chain which is generally more correct way in comparison with inserting them in the beginning.

However, strictly speaking this method implies a requirement to set: Internet Firewall - Basic Config - Logged packets type: NONE

polde
24-12-2007, 13:46
Hello,

Default configuration is following:


# Port range to use for listening.
port_range = 51777-51780

i use this port range and this iptables WHY? I have set ssh and other ports to open state.

example:


for P in 22 8008 10000:11000; do
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT
done

Some one know what is this seating


# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes

Artus
25-12-2007, 20:09
Hi!
I need some help, i done everything as written here, but screen and rtorrent doesn't seem to start. i have no idea why. lighttpd is working fine.
any ideas/suggestions?

mancub
26-12-2007, 04:25
Hi!
I need some help, i done everything as written here, but screen and rtorrent doesn't seem to start. i have no idea why. lighttpd is working fine.
any ideas/suggestions?

I suggest you check if they are all installed properly and that they run on their own (so try them independently).

Maybe your S99rtorrent isn't chmod a+x? Also, see if there's anything in the logs as well...

Artus
26-12-2007, 12:50
during screen install:


Configuring screen
chown: unknown user name: root
Successfully terminated.


is that ok?

S99rtorrent's chmod is ok
thanks for the help!

Pulver
05-01-2008, 17:47
Thanks for this tutorial.

Would it be possible to get wtorrent (http://canbruixa.homelinux.net/wt/) working ?

Anyway, I'm stuck with the "500 - Internal Server Error" when I'm trying mylocalip:8081/RPC2

It seems that rtorrent isn't starting with correct options, when I type ps I get:


103 admin 1340 S /opt/sbin/lighttpd -f /opt/etc/lighttpd/lighttpd.conf
106 admin 752 R dropbear
123 admin SW [kjournald]
127 admin 568 S -sh
208 admin 812 S SCREEN -dm -S rtorrent
210 admin 488 S /bin/sh
214 admin 400 R ps

I'm missing the "-n -o import=...rtorrent.conf" - right ?

lighttpd is working and when I start S99rtorrent manually - it starts with no errors.

However, when I do "./S99rtorrent stop" I get:


Stopping rtorrent: rtorrentcat: /opt/share/torrent/work/rtorrent.lock: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
.

But I think I have made everything according to the guide - any ideas ?

polde
05-01-2008, 19:59
hey

Try with this script for me its working.



#!/bin/sh
/opt/bin/screen -dmS rtorrent rtorrent -o import="/opt/etc/rtorrent.conf" 2>&1 >/tmp/rtl


edit
dont start rtorrent with /S99rtorrent stop i run to some problem because of bash scripting.
wtorrent is also working go trough installation guied on wtorrent page
whit lastest build AJAX I have some problems in firefox

Bye

polde
05-01-2008, 20:02
during screen install:


Configuring screen
chown: unknown user name: root
Successfully terminated.


is that ok?

S99rtorrent's chmod is ok
thanks for the help!

this is normal everyting its working i also run to this problem it OK

ssyyzz
05-01-2008, 20:05
I get rtorrent working with



scgi.server = (
"/RPC2" =>
( "127.0.0.1" =>
(
"host" => "127.0.0.1",
"port" => 5000,
"check-local" => "disable"
)
)
)


in lighttpd.conf

and



scgi_port = localhost:5000


in rtorrent.conf instead of scgi_local = /opt/var/run/rpc.socket

Pulver
05-01-2008, 20:47
Thanks for your hints!

I tried some different settings, but it turned out to be my rtorrent.conf that had an error.

(had to start rtorrent "normal" to find that out)

I'm using ssyyzz:s config.

Now its working :)

Will try wtorrent tomorrow.

Thanks again for this tutorial :)

Pulver
06-01-2008, 11:24
I know that this is a bit off from the subject, but I'm stuck on the wtorrent install and was wondering if polde (or anyone else) could help me ?

nTorrent is working and I'm using ssyyzz:s konfiguration from above.

I have installed php-fcgi, edited lighttpd.conf and PHP is working.

I have edited wtorrent/conf/home.conf.php and put chmod 777 on db, torrents and tpl_c

When I browse to install.php I get the wtorrent install username/password page - but when I press "create" I get an empty red error-square.

I think there is something wrong in home.conf.php ?

I have set correct path:s and changed RT_AUTH to false - but there is no change.

Any ideas what is wrong ?

polde
06-01-2008, 12:07
here is my config from wtorrent


<?php
// Base URL of application (where index.php is)
define( 'URL', 'http://canbruixa.homelinux.net/wtorrent/' );
define( 'BASE', 'http://canbruixa.homelinux.net/wtorrent/' );

// SQLite database file (set folder permision 0777 or chmod to httpd server) (wTorrent will create database when running install.php)
define( 'DB_FILE', 'db/database.db');

// Host or IP to connect to rTorrent
define( 'RT_HOST', 'localhost');
define( 'RT_PORT', 8008);
define( 'RT_DIR', 'RPC2/');
define( 'RT_AUTH', false);
define( 'RT_USER', 'admin');
define( 'RT_PASSWD', '****');
// where to use multicall or not
// if wTorrent makes your rtorrent crash, set this to true
define( 'NO_MULTICALL', true);

// Directory in which to save uploaded .torrent files (set folder permision 0777 or chmod to httpd server)
define( 'DIR_TORRENTS', 'torrents/');

// Full path to application directory (where index.php is)
define( 'DIR_EXEC', '/opt/share/www/lighttpd/wtorrent/');

// Permision to set for uploaded .torrent files (don't touch unless you know)
define( 'PERM_TORRENTS', 0777);

// Default location to save downloaded files (can be set for every uploaded .torrent on the ui)
define( 'DIR_DOWNLOAD', '/mnt/rtorrent/work/');

// Don't touch any of the data below unless you know what you are doing
define( 'DIR_LANG', 'home/lang/' );
define( 'DIR_TPL', 'home/tpl/' );
define( 'DIR_TPL_COMPILE', 'tpl_c/' );
define( 'DIR_TPL_HTML', 'home/html/' );
define( 'DIR_BACKUP', 'backup/' );
define( 'DIR_UPLOAD', 'torrents/');

define( 'TITLE', 'wTorrent' );
define( 'META_TITLE', 'rTorrent web interface' );
define( 'META_KEYWORDS', 'rtorrent xmlrpc interface php web html' );
define( 'META_DESCRIPTION', 'rtorrent web inrface using xmlrpc' );

define( 'DIR_CSS_DETALLS', 'home/css/detalls.css' );
define( 'DIR_CSS_ESTIL', 'home/css/estil.css' );
define( 'DIR_JS', 'home/js/javasc.js' );
define( 'DIR_FAVICO', 'favicon.ico' );
//define( 'USER_RTORRENT', 'rtorrent');

define( 'DIR_IMG', 'home/img/' );
define( 'SRC_INDEX', 'index.php' );

define( 'SCRAMBLE', false);
define( 'APP', 'wTorrent' );

// Librerias generales
require_once( 'lib/inc/includes.inc.php' );

// Autodeclaracion de clases
autoload( 'lib/cls/', 'cls/', 'home/cls/' );
// Definicion de rutas para UNIX
ini_set( 'include_path', DIR_EXEC );
?>


and my rtorrent config



#scgi_local = /opt/var/run/rpc.socket
scgi_port = 127.0.0.1:5000
send_buffer_size = 65536
min_peers = 20
max_peers = 50
max_uploads = 5
download_rate = 100
upload_rate = 100
directory = /mnt/rtorrent/work/
schedule = watch_directory,5,5,load_start=/mnt/rtorrent/dl/*.torrent
session = /mnt/rtorrent/session
port_range = 51777-51780
check_hash = yes
use_udp_trackers = yes
schedule = ratio,30,60,stop_on_ratio=200



and lightphp


"mod_access",
"mod_fastcgi",
"mod_scgi",
# "mod_cml",
# "mod_trigger_b4_dl",
"mod_auth",
# "mod_status",
# "mod_setenv",
# "mod_fastcgi",
# "mod_proxy",
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
# "mod_cgi",
# "mod_compress",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
"mod_accesslog" )

## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "/opt/share/www/lighttpd/"

## where to send error-messages to
server.errorlog = "/opt/var/log/lighttpd/error.log"

# files to check for if .../ is requested
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )
## deny access the file-extensions
#
# ~ is for backupfiles from vi, emacs, joe, ...
# .inc is often used for code includes which should in general not be part
# of the document-root
url.access-deny = ("~", ".inc", ".db", ".tpl.php", ".cls.php",".sqlite")

$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}

################################################## #################################
fastcgi.server = ( ".php" =>
((
"host" => "127.0.0.1",
"port" => 1026,
))
)

##### wtorrent
scgi.server = (
"/RPC2" => # RT_DIR
( "127.0.0.1" =>
(
"host" => "127.0.0.1", # Ip where rtorrent is listening
"port" => 5000, # Port specified in .rtorrent.rc
"check-local" => "disable"
)
)
)

hope it helps :D

Pulver
06-01-2008, 14:29
Thanks a lot :)

One small thing: your lighttpd.conf is missing:


server.modules = (

at the very top (could be useful for someone else)

Also - "server.port = 8080" is missing (?)

Anyway - we have about the same configuration - but I still have the same problem.

Now I have looked at my error.log from lighttpd and found this:



(mod_fastcgi.c.2570) FastCGI-stderr: PHP Fatal error: Class 'SQLiteDatabase' not found in /opt/share/www/lighttpd/wtorrent/install.php on line 23

(mod_fastcgi.c.2570) FastCGI-stderr: PHP Fatal error: Class 'SQLiteDatabase' not found in /opt/share/www/lighttpd/wtorrent/lib/cls/Web.cls.php on line 46

What is strange is that the 2 different errors comes randomly, mostly the first one - but the second is also there a couple of times (during my many retries)

Is there something wrong with my fastcgi or with the wtorrent script ? (not very likely)

Or have I missed something simple ? (more likely)

polde
06-01-2008, 20:01
OK here is server modul


server.modules = (
# "mod_rewrite",
# "mod_redirect",
# "mod_alias",
"mod_access",
"mod_fastcgi",
"mod_scgi",
# "mod_cml",
# "mod_trigger_b4_dl",
"mod_auth",
# "mod_status",
# "mod_setenv",
# "mod_fastcgi",
# "mod_proxy",
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
# "mod_cgi",
# "mod_compress",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
"mod_accesslog" )


port


## bind to port (default: 80)
server.port = 8008


url.access


url.access-deny = ("~", ".inc", ".db", ".tpl.php", ".cls.php",".sqlite")

$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}

##
# which extensions should not be handle via static-file transfer
#
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
static-file.exclude-extensions = ( ".fcgi", ".php", ".pl", ".py", ".rb" )



one more thing :) did you install SQLlight :P

i use 20071107 version of wtorrent AJAX give me some problems

Pulver
06-01-2008, 20:37
one more thing :) did you install SQLlight :P

i use 20071107 version of wtorrent AJAX give me some problems

Well, when I wrote my last entry I had not installed the 'sqlite' package, but since then I have installed both the sqlite package, restarted everything (same problem) - removed it and installed the sqlite2 package and restarted - still same problem.

Im using the 20071107 version of wtorrent too.

Otherwise - our setups are similar, I have the same entrys that you have.

I made a search and found a thread (in russian) in this forum where someone have the same problem - Link (http://www.wl500g.info/showthread.php?t=5438&page=27) - but since I dont know russian, I dont know how they solved it ;)

ferges
06-01-2008, 21:25
I don't know why, but my rtorrent stopped working. I can connect with lighttpd, but not with rpc2 - I get "500 - Internal Server Error". When I resume screen (screen -r), I see rtorrent is not working. Any help?

polde
07-01-2008, 09:56
Hey

For Russian translation use google (http://www.google.si/language_tools?hl=en)

or direct link to translated (http://translate.google.com/translate?u=http%3A%2F%2Fwww.wl500g.info%2Fshowthr ead.php%3Ft%3D5438%26page%3D27&langpair=ru%7Cen&hl=en&ie=UTF-8)web

Pulver
07-01-2008, 21:20
Thanks Polde, I have read it - but I still cant find the solution (I might be stupid - I know ;) )

I made a total clean install (total erase of the harddrive and reset of Oleg), reinstalled everything and still have the same problem.

I think I'm missing an important package ?

This is what I have installed:


bash - 3.2.17-1 - A bourne style shell
bzip2 - 1.0.4-2 - Very high-quality data compression program
cyrus-sasl-libs - 2.1.22-2 - Provides client or server side authentication (see RFC 2222).
gdbm - 1.8.3-2 - GNU dbm is a set of database routines that use extensible hashing. It works similar to the standard UNIX dbm routines.
ipkg-opt - 0.99.163-9 - The Itsy Package Manager
libcurl - 7.17.0-3 - Curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FI
libdb - 4.2.52-3 - Berkeley DB Libraries
libsigc++ - 2.0.18-1 - libsigc++ implements a typesafe callback system for standard C++.
libtorrent - 0.11.9-1 - libtorrent is a BitTorrent library with a focus on high performance and good code.
libuclibc++ - 0.2.2-4 - C++ standard library designed for use in embedded systems
libxml2 - 2.6.30-2 - Libxml2 is the XML C parser and toolkit developed for the Gnome project.
libxslt - 1.1.22-1 - An XML Stylesheet processor based on libxml2
lighttpd - 1.4.18-1 - A fast webserver with minimal memory footprint.
nano - 2.0.7-1 - A pico like editor
ncurses - 5.6-3 - NCurses libraries
ncursesw - 5.6-1 - NCurses libraries with wide char support.
openldap-libs - 2.3.38-1 - Open Lightweight Directory Access Protocol
openssl - 0.9.7m-3 - Openssl provides the ssl implementation in libraries libcrypto and libssl, and is needed by many other applications and librari
pcre - 7.4-1 - Perl-compatible regular expression library
php - 5.2.5-1 - The php scripting language
php-fcgi - 5.2.5-1 - The php scripting language, built as an fcgi module
readline - 5.2-2 - The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are
rtorrent - 0.7.9-2 - rtorrent is a BitTorrent client for ncurses, using the libtorrent library.
screen - 4.0.3-2 - A screen manager that supports multiple logins on single terminal
sqlite - 3.5.4-1 - SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.
termcap - 1.3.1-2 - Terminal emulation library
uclibc-opt - 0.9.28-12 - micro C library for embedded Linux systems
xmlrpc-c - 1.11.00-2 - A library providing modular implementation of XML-RPC for C and C++.
zlib - 1.2.3-2 - zlib is a library implementing the 'deflate' compression system.

Can anyone see whats missing to get sqlite + php-fcgi working ?

Again - this the error I'm getting:


(mod_fastcgi.c.2570) FastCGI-stderr: PHP Fatal error: Class 'SQLiteDatabase' not found in /opt/share/www/lighttpd/wtorrent/install.php on line 23

polde
08-01-2008, 11:01
hey

can you post your config files here

rtorrent.conf, lihthttp.conf and wtorrent config file.

Regards,
M

Pulver
08-01-2008, 18:46
hey

can you post your config files here

rtorrent.conf, lihthttp.conf and wtorrent config file.

Regards,
M

Sure :)

rtorrent.conf:



min_peers = 20

max_peers = 40

max_uploads = 5

download_rate = 1300

upload_rate = 1300

directory = /tmp/harddisk/torrent/download/

schedule = watch_directory,5,5,load_start=/tmp/harddisk/torrent/torrentfiles/

port_range = 5330-5480

port_random = yes

scgi_port = 127.0.0.1:5000

lighttpd.conf:


server.modules = (

"mod_access",

"mod_auth",

"mod_fastcgi",

"mod_scgi",
"mod_accesslog" )

server.document-root = "/opt/share/www/lighttpd/"

server.errorlog = "/opt/var/log/lighttpd/error.log"

index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )


accesslog.filename = "/opt/var/log/lighttpd/access.log"

url.access-deny = ("~", ".inc", ".db", ".tpl.php", ".cls.php",".sqlite")

$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}

static-file.exclude-extensions = ( ".fcgi", ".php", ".pl", ".py", ".rb" )

server.port = 8081

server.pid-file = "/var/run/lighttpd.pid"

fastcgi.server = ( ".php" =>
((
"host" => "127.0.0.1",
"port" => 1026,
))
)

scgi.server = (
"/RPC2" => # RT_DIR
( "127.0.0.1" =>
(
"host" => "127.0.0.1", # Ip where rtorrent is listening
"port" => 5000, # Port specified in .rtorrent.rc
"check-local" => "disable"
)
)
)


wtorrent.conf:


// Host or IP to connect to rTorrent
define( 'RT_HOST', 'localhost');
define( 'RT_PORT', 8081);
define( 'RT_DIR', 'RPC2/');
define( 'RT_AUTH', false);
define( 'RT_USER', 'admin');
define( 'RT_PASSWD', 'password');
// where to use multicall or not
// if wTorrent makes your rtorrent crash, set this to true
define( 'NO_MULTICALL', true);

// Directory in which to save uploaded .torrent files (set folder permision 0777 or chmod to httpd server)
define( 'DIR_TORRENTS', 'torrents/');

// Full path to application directory (where index.php is)
define( 'DIR_EXEC', '/opt/share/www/lighttpd/wtorrent/');

// Permision to set for uploaded .torrent files (don't touch unless you know)
define( 'PERM_TORRENTS', 0777);

// Default location to save downloaded files (can be set for every uploaded .torrent on the ui)
define( 'DIR_DOWNLOAD', '/tmp/harddisk/torrent/download/');

// Don't touch any of the data below unless you know what you are doing
define( 'DIR_LANG', 'home/lang/' );
define( 'DIR_TPL', 'home/tpl/' );
define( 'DIR_TPL_COMPILE', 'tpl_c/' );
define( 'DIR_TPL_HTML', 'home/html/' );
define( 'DIR_BACKUP', 'backup/' );
define( 'DIR_UPLOAD', 'torrents/');

define( 'TITLE', 'wTorrent' );
define( 'META_TITLE', 'rTorrent web interface' );
define( 'META_KEYWORDS', 'rtorrent xmlrpc interface php web html' );
define( 'META_DESCRIPTION', 'rtorrent web inrface using xmlrpc' );

define( 'DIR_CSS_DETALLS', 'home/css/detalls.css' );
define( 'DIR_CSS_ESTIL', 'home/css/estil.css' );
define( 'DIR_JS', 'home/js/javasc.js' );
define( 'DIR_FAVICO', 'favicon.ico' );
//define( 'USER_RTORRENT', 'rtorrent');

define( 'DIR_IMG', 'home/img/' );
define( 'SRC_INDEX', 'index.php' );

define( 'SCRAMBLE', false);
define( 'APP', 'wTorrent' );

// Librerias generales
require_once( 'lib/inc/includes.inc.php' );

// Autodeclaracion de clases
autoload( 'lib/cls/', 'cls/', 'home/cls/' );
// Definicion de rutas para UNIX
ini_set( 'include_path', DIR_EXEC );


(ports and password are fake)

I have tried different download locations (/opt) since I read that /tmp could cause problems (?) but it didn't help.

I have also used a session directory for rtorrent, but that didnt help either.

Looking at it now, there might be something wrong in lighttpd.conf ?

Thanks for your help.

polde
09-01-2008, 10:09
hey

did u put
extension=sqlite.so
extension=pdo.so to php.ini ?

what about ntorrent did you try it ?

Pulver
09-01-2008, 17:42
hey

did u put
extension=sqlite.so
extension=pdo.so to php.ini ?

what about ntorrent did you try it ?

ntorrent works for me.

Just to make things clear, I did try the extensions above to php.ini after reading the translated page the you linked earlier - but it did not help me.... then.

Now I tried it again - restarted the router and... it works! :)

I dont know whats different now from my earlier setup, but I dont care anymore ;)

wtorrent is kind of slow, but hey - its working, and it is a wonderful tool to manage rtorrent :)

BIG thanks for all your help polde!

:)

Pulver
09-01-2008, 19:34
I dont know whats different now from my earlier setup, but I dont care anymore

Come to think about it - I might have forgotten to restart the router last time I tried.

And then I erased it from php.ini

darn :)

polde
09-01-2008, 22:12
Hey

it nice that its working. I use Wtorrent to upload torrents file becuse u can put it to new folder /mnt/work/dvd for example and ntorrent for watching the transfer :)

kanguru
11-01-2008, 04:05
Hi. Nice how to.

How can i limit the workload of rtorrent. I tried it with a torrent and after downloading for a while at fullspeed the router was almost dead ehe. It ate lots of ram and cpu and i couldn't even see webpages :)

I also want to know where in that script i can use the comand nice, to put this process in low priority.

Again, thanks for the HOWTO.

bugmenot
14-01-2008, 14:49
Please report bugs/feature requests to:

http://canbruixa.homelinux.net/trac/

Thanks

Zapt
15-01-2008, 20:36
Could somebody please post a HOWTO?

polde
20-01-2008, 22:21
i will post it next week.

Ntorrent or wtorrent?

for me ntorrent is better because w torrent take too much resources .

munky
22-01-2008, 00:36
Hi,

I've been following the goings-on here, as i've been trying to move from Transmission to RTorrent, but I want a decent webui.

What I dont understand is why fastcgi has a port of 1026 - what is listening on this port?

I'm at the point that rtorrent works and is controllable via ntorrent - so I guess all my XML-RPC and wotnot are configured correctly. I have installed the two .so modules to lighttpd, as directed, and ive copied your configs almost verbatim here, but I still get 500 internal server error while trying to hit install.php. tailing the lighttpd logs shows:

(mod_fastcgi.c.2757) establishing connection failed: Connection refused socket: tcp:127.0.0.1:1026

(mod_fastcgi.c.2703) fcgi-server re-enabled: tcp:127.0.0.1:1026

which makes sense to me, as i dont see anything that should be listening on that port.... please enlighten me!

One other thing - S99rtorrent does not execute by itself on startup, despite being +x. If I run it manually it works fine. Any ideas how to troubleshoot this? (im a bit of a linux newbie).

Many thanks for the great work on this thread so far... i'm really happy to have ntorrent and rtorrent working, i'd just like to add the webui if i can... :)

al37919
22-01-2008, 00:53
One other thing - S99rtorrent does not execute by itself on startup, despite being +x. If I run it manually it works fine. Any ideas how to troubleshoot this? (im a bit of a linux newbie).

install the last versions of rtorrent and libtorrent (SVN-1027). The S99rtorrent was reworked there. Post here if it doesn't work again.

munky
22-01-2008, 01:12
used this:

fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fcgi.sock",
"bin-path" => "/opt/bin/php-fcgi",
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "4",
"PHP_FCGI_MAX_REQUESTS" => "4000"
)
)
)
)

which i found here: http://www.nslu2-linux.org/wiki/HowTo/DeployPHPWebAppUsingFastCGI

re: the S99 thing... i actually replaced my S99 with the one in this thread, then to the very minimal one in this thread because the first one kept failing with sed problems. will the standard S99rtorrent work with this RPC / ntorrent / wtorrent setup?

EDIT: Answer is no. Will have to patch my freshly installed S99rtorrent...

al37919
22-01-2008, 09:19
Answer is no
The new S99rtorrent has advantage that it has been rewritten to eliminate need in bash. So, it uses standard /bin/sh as interpreter and it runs fine during startup. The disadvantage for you is that it runs rtorrent as a non root user (which is a recommended way to run p2p software), so either you should follow this guide: http://wl500g.info/showpost.php?p=66875&postcount=19 or edit it similarly to the file on the first page to enable strting by root.

munky
22-01-2008, 17:55
thanks al379... i'll give that a try now :)

had some weird goings on, like loads and loads of instances of php-fcgi running. might try to get it working the same way guys here have.

actually, on reflection, i might just give up and just use ntorrent - i had that working nicely ;) hmm.. can you get ntorrent in an applet? can we serve applets from the asus?

wikiped
25-01-2008, 11:45
I get rtorrent working with



scgi.server = (
"/RPC2" =>
( "127.0.0.1" =>
(
"host" => "127.0.0.1",
"port" => 5000,
"check-local" => "disable"
)
)
)


in lighttpd.conf

and



scgi_port = localhost:5000


in rtorrent.conf instead of scgi_local = /opt/var/run/rpc.socket

Not sure how this "scgi.server =" could help a thing as it is not recognised but the lighttpd ;-)



Starting web server: lighttpd
2008-01-25 13:24:12: (server.c.918) WARNING: unknown config-key: scgi.server (ignored)


Oops... found that ther was "mod_scgi" missing in the list of enabled modules in lighttpd.conf.

al37919
25-01-2008, 12:28
had some weird goings on, like loads and loads of instances of php-fcgi running.

To limit number of running processes php-fcgi from something like 8 to something like 2, add the following to the file lighttpd.conf in the section fastcgi.server

"min-procs" => 1,
"max-procs" => 1,
"max-load-per-proc" => 4,

22chemik
28-01-2008, 00:15
Hello friends,
I am novice so
Does it work rtorrent+ntorrent configuration even when my Pc is off?
I am using transsmision, probably if it is working when the Pc is offline I will migrate to this one.

Thanx

Kolandr
29-01-2008, 01:39
Hello friends,
I am novice so
Does it work rtorrent+ntorrent configuration even when my Pc is off?
I am using transsmision, probably if it is working when the Pc is offline I will migrate to this one.

Thanx

rtorrent runs on your router. nTorrent - it's only ånvironment for rtorrent,which runs from u Pc. u can add/delete torrents with ntorrent and after that shutdown your Pc.

lyka
30-01-2008, 19:41
today i can't access to myrouter:8081/RPC2.

i have 500 internal server error.

i checked with ipkg list_update, and i found that my router updated rtorrent to:
rtorrent - 0.8.0-1

i can't make it work now.

t68kv
31-01-2008, 01:09
yup, we are same bro, after updated to rtorrent 0.8

ow shit hahaha.

anyway i return to sctcs again, cause ntorrent still have a lots of bug and enchancement to do.

t68kv
31-01-2008, 20:43
i already fix the issues about upgrade version, sadly to say, you will need to edit the s99torrent manualy again, ill post mine later and also you need to upgrade all software you have in the system.

My only problem now is still getting 500 - Internal Server Error
even rtorrent is started without problem.

t68kv
01-02-2008, 22:01
at last i already finish the combination version of rtorrent/libtorrent + settings + php. I took me hours huhuh

lyka
02-02-2008, 14:05
I just solved my problem, by removing lighttpd screen bash rtorrent and reinstalling.

Then i edited S99torrent just replacing:

user="p2p"

with

user="admin"

which is my user on asus router.

This solved my issue.


is 0.8 a beta? Because on some tracker is banned.:(

lyka
11-02-2008, 23:43
someone got rtorrent 0.7.9 and libtorrent 0.11.9 in ipk format? Because i updated and can't find the package to downgrade.

al37919
12-02-2008, 09:47
http://wl500g.info/showpost.php?p=79879&postcount=557

starbay
12-02-2008, 22:36
Is it possible to make rtorrent auto-start torrents processing after router turn-on?
I've checker rtorrent.conf and did not find any setting related to this.
Thanks in advance.

lyka
11-03-2008, 09:06
last night i tried wtorrent, really nice but i found it too slow. When i click on a torrent to get infos and details it just takes minutes before i see something. The same is when i log in.

Anyone noticed the same?

lyka
12-03-2008, 00:18
reading on the site of ntorrent (http://code.google.com/p/ntorrent/), i saw that the build files are now created.
Some week ago i tried to build the svn version of ntorrent without success, now it just works, and have some really nice improvement, starting from the autoconnect feature, going to a better sorting method and plugins enhancements.

The only thing i miss is the feed option present in some other gui.

from the author site:


You can download nTorrent from the "downloads tab" on this page. If you however is interested in the latest version, you can download from the SVN repository.

# svn co http://ntorrent.googlecode.com/svn/trunk ntorrent

This will create a folder ntorrent containing the sourcefiles in your current working directory. to run the latest version you can issue "ant run" within the ntorrent directory. check build.xml for other build targets.

light
25-03-2008, 21:17
Anyone knows if its possible block some peers?

light
27-03-2008, 17:36
Is possible block some peers?

ColTuci
28-03-2008, 18:23
I tried to install rtorrent from the howto, but for the http://192.168.1.1:8081/RPC2 there is some 500- internal server error and nothing else. :(
On http://192.168.1.1:8081 everithing is ok, on ps there is lighttpd, and rtorrent.

In the lighttpd error log:


1970-01-01 01:00:10: (log.c.75) server started
2008-03-28 18:14:47: (mod_scgi.c.2219) establishing connection failed: Connection refused
2008-03-28 18:14:47: (mod_scgi.c.2353) fcgi-server disabled: 127.0.0.1 5000
2008-03-28 18:14:47: (mod_scgi.c.2821) no fcgi-handler found for: /RPC2


lighttpd.conf:


server.modules = (
"mod_access",
"mod_scgi",
"mod_accesslog" )

server.document-root = "/opt/share/www/lighttpd/"

server.errorlog = "/opt/var/log/lighttpd/error.log"

index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )

mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".wma" => "audio/x-ms-wma",
".wax" => "audio/x-ms-wax",
".ogg" => "application/ogg",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xbm" => "image/x-xbitmap",
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".asc" => "text/plain",
".c" => "text/plain",
".cpp" => "text/plain",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
".txt" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf",
".wmv" => "video/x-ms-wmv",
".bz2" => "application/x-bzip",
".tbz" => "application/x-bzip-compressed-tar",
".tar.bz2" => "application/x-bzip-compressed-tar"
)

accesslog.filename = "/opt/var/log/lighttpd/access.log"

url.access-deny = ( "~", ".inc" )

$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}

static-file.exclude-extensions = ( ".fcgi", ".php", ".pl", ".py", ".rb" )

server.port = 8081

server.pid-file = "/var/run/lighttpd.pid"

scgi.server = (
"/RPC2" =>
( "127.0.0.1" =>
(
"host" => "127.0.0.1",
"port" => 5000,
"check-local" => "disable"
)
)
)


rtorrent.conf: (BTW there was no scgi_port tag in the original config file, is this ok?)


scgi_port = localhost:5000

min_peers = 20

max_peers = 40

max_uploads = 5

download_rate = 600

upload_rate = 40

directory = /opt/share/torrent/work/

schedule = watch_directory,5,5,load_start=/opt/share/torrent/dl/*.torrent
schedule = untied_directory,5,5,stop_untied=

session = /opt/share/torrent/work

port_range = 10000-11000

check_hash = yes

schedule = ratio,30,60,stop_on_ratio=200

encryption = prefer_plaintext


thnx

gouryella
03-05-2008, 13:18
ver. 0.5 of nTorrent without lighttpd php and /RPC2 dance compressed guide :D
connection throught SSH on port 5000 (Attach pic.)
UPDATED 10.10.2008
best install after you finished wengi guide (checked on oleg's 1.9.2.7-10, but i don't use 3 partition like /tmp/mnt/disc0_3/torrent/(because have only 16GB Flash drive))


ipkg update
ipkg upgrade
ipkg install rtorrent
ipkg install screen
mkdir /opt/share/torrent/session

You don't need other packages like php, lighttpd, dependence is OK

rm /opt/etc/rtorrent.conf
nano /opt/etc/rtorrent.conf


scgi_port = localhost:5000
min_peers = 20
max_peers = 40
max_uploads = 5
download_rate = 0
upload_rate = 30
check_hash = no
directory = /opt/share/torrent/work
schedule = watch_directory,5,5,load_start=/opt/share/torrent/dl/*.torrent
schedule = untied_directory,5,5,stop_untied=
schedule = low_diskspace,5,60,close_low_diskspace=10M
session = /opt/share/torrent/session
port_range = 51777-51780
use_udp_trackers = yes
schedule = ratio,30,60,stop_on_ratio=100
safe_sync = yes
dht = auto
dht_port = 6881
peer_exchange = yes

nano /usr/local/sbin/post-firewall


iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 51777:51780 -j ACCEPT
iptables -I INPUT 1 -p udp -i "$1" --dport 6881 -j ACCEPT



nano /opt/etc/init.d/S99rtorrent
you must edit some code, to start rtorrent with right config file

unsharp and change #replace dirlayout=RTORRENT_DEFAULT to: replace dirlayout=RTORRENT_ANOTHER
change user="user" to: user="your_login_name"
change logfile="/opt/var/log/rtorrentInit.log" to: logfile="/opt/share/torrent/rtorrentInit.log"


reboot, wait a minute try to connect ntorrent, happy torrenting :-)

Debugging:
try and watch for errors, ad is in /opt/share/torrent/rtorrentInit.log:

rtorrent -n -o import=/opt/etc/rtorrent.conf

Credits:
mancub 1st guide
ecori start script changes

djmickey83
18-06-2008, 11:35
Hi!

I followed gouryella's "how to", And managed to make it run, but now, when I put something to download it says Timeout was Reached.
How can I fix that...
I'm a totally newbie when it comes to linux...
Pls HELP!

poiu
30-06-2008, 14:59
Y really cant get it now :(.
Try to setup rtorrent without lightttpd, using Gouryella setup and run in this :
[admin@router root]$ sh /opt/etc/init.d/S99rtorrent start
[: missing argument after `RTORRENT_DEFAULT'
[: missing argument after `RTORRENT_DEFAULT'
[: missing argument after `RTORRENT_DEFAULT'
Starting rtorrent: rtorrent.
Then :
[admin@router root]$ ps axf
PID TTY STAT TIME COMMAND
1 ? S 0:01 /sbin/init
2 ? S 0:00 [keventd]
3 ? RN 0:00 [ksoftirqd_CPU0]
4 ? S 0:00 [kswapd]
5 ? S 0:00 [bdflush]
6 ? S 0:00 [kupdated]
7 ? S 0:00 [mtdblockd]
61 ? S 0:01 httpd vlan1
63 ? Ss 0:00 nas /tmp/nas.lan.conf /tmp/nas.lan.pid lan
67 ? S 0:00 klogd
69 ? S 0:00 [dnsmasq]
70 ? S 0:00 [khubd]
82 ? S 0:00 [usb-storage-0]
83 ? S 0:00 [scsi_eh_0]
131 ? Ss 0:00 watchdog
133 ? Ss 0:00 \_ ntp
142 ? S 0:00 dropbear -p 22 -j -k
197 ? Ss 0:01 \_ dropbear -p 22 -j -k
198 pts/0 Ss 0:00 \_ -sh
341 pts/0 R+ 0:00 \_ ps axf
159 ? S 0:00 [kjournald]
160 ? S 0:00 [kjournald]
162 ? Ss 0:00 /usr/sbin/nmbd -D
164 ? Ss 0:00 /usr/sbin/smbd -D
337 ? S 0:00 \_ [smbd]
189 ? S 0:00 /sbin/syslogd -m 0 -O /opt/var/log/syslog.log -S -l 7 -s 0
196 ? Ss 0:00 /opt/sbin/cron
244 ? Ss 0:00 /opt/bin/SCREEN -dmS rtorrent rtorrent -o import=/opt/etc/rtorrent.conf
248 pts/1 Ss+ 0:00 \_ rtorrent -o import=/opt/etc/rtorrent.conf

And try to connect via ssh with win client 0.5 ntorrent but "connection reset" .
Maybe my bad wealth have a word here.
Need some directions here, pls.

LE: with Litghttpd work though ....
But i will like without ...

Artus
30-06-2008, 15:41
Hi!

I followed gouryella's "how to", And managed to make it run, but now, when I put something to download it says Timeout was Reached.
How can I fix that...
I'm a totally newbie when it comes to linux...
Pls HELP!

i had the same problem, but now, its working. i think something got updated with ipkg, and now its the same as it was.

Serpent
02-07-2008, 16:16
Gouryella's HowTo is very pragmatic, but is working.
A much elegant (conformable to start/stop scripts) approach is al37919's short how to (http://wl500g.info/showpost.php?p=66875&postcount=19).
And poiu, don't forget to add scgi_port = localhost:5000 in your /opt/etc/rtorrent.conf

poiu
02-07-2008, 20:48
Serpent, i do that allready, this is the result ..
I uninstall rtorrent/lighthtpd/screen, do all dance again, the same.
T he good news i manage to make ntorrent gui work somehow, for 1 day, but today failed for some reason .
Cant connect with lighttpd or without on 5000 routed by ssh.
Rtorrent is there, on console working (lynx), starting with the same errors.
Router is on a ups, so no power fail here ..
Gouryella wont work for me, try't again.
I try http://wl500g.info/showthread.php?t=14534&highlight=rtorrent but i get some xtml/html error in all browsers.
I am sick for now, but i get crazy too with this stubborn rtorrent ....and the humor in this is a wile ago i manage to get rtorrent work with ease, but i upgrade to .10 so all was lost.

msj33
10-07-2008, 14:57
Hi

I am having severe problems with getting Rtorrent to work proberly.

I have read the whole thread, but can not get it to work

I also end up having problems with "a timeout was reached"

Have tried everything(reinstallation, firewall settings etc.)

Can someone please post WORKING firewall, rtorrent.conf and S99rtorrent files - then i can compare them to what i have,

Hope you can help me out here, because i really wanna start using Rtorrent on my Asus wl500g Premium

My setup is excatly as gouryella posts on the thread.

I have Rtorrent 0.7.9-2 and libtorrent 0.11.9-1

But i am a bit confused about S99rtorrent.

Should it only have:
#!/bin/sh
/opt/bin/screen -dmS rtorrent rtorrent -o import="/opt/etc/rtorrent.conf" >&1 >/tmp/rtl
or

Should i preserve the original one, and just add the above?

Thanks

Morten

wirespot
10-07-2008, 16:20
S99rtorrent is just a side issue, if rtorrent doesn't work when started directly it won't work better when running in screen.

But here's how I start it, anyway:


(/opt/bin/screen -d -m -fn \
/opt/bin/rtorrent -o import=/usr/local/sbin/.rtorrent.rc) &

Regarding connectivity, I suspect you may have firewall issues. What ports are you using in your rtorrent config? Have you allowed them to be accessed in the firewall? Please remember that the Virtual Servers part of the graphical admin interface is only for port forwarding, ie. allowing traffic from outside to reach computers in your LAN. But if you need to open ports for something that runs on the router you need to use iptables commands in /usr/local/sbin/post-firewall.

For instance, if you have "port_range = 65000-65535" in rtorrent.rc, you need to have something like this in /usr/local/sbin/post-firewall:


iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 65000:65535 -j ACCEPT

Also, if you have "dht = on" and "dht_port = 65000", you also need to open 65000 on UDP like this:


iptables -I INPUT 1 -p udp -i "$1" --dport 65000 -j ACCEPT

msj33
10-07-2008, 21:06
I used standard ports 10000-11000 - Even tried to change them without luck.

I have also portforwarded the ports in my Dlink Modem/router.

I have Enhanced Ctorrent running at the moment with YODCTCS, without any issues. Except, it is very slow and somehow buggy.

I have the following setup in my files:

/opt/etc/rtorrent.conf


scgi_port = localhost:5000
session = /tmp/mnt/disc1_1/torrent/session
port_range = 10000-11000
directory = /tmp/mnt/disc1_1/torrent/dl
check_hash = yes
encryption = prefer_plaintext
stop_on_ratio = 100
upload_rate = 50
max_uploads = 15

/usr/local/sbin/post-firewall

for P in 10000:11000; do
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT


/opt/etc/init.d/S99rtorrent (Is this correct??)

#!/bin/sh
/opt/bin/screen -dmS rtorrent rtorrent -o import="/opt/etc/rtorrent.conf" >&1 >/tmp/rtl

As soon as i start Rtorrent i get "a timeout was reached" both in Screen and Ntorrent.

Both Session and Directory paths are created with admin permissions.

Everyone says, that its a firewall issue - but where? I opened both ports in IPTABLES and my Modem/router.

My ASUS is NOT setup like a router - Only as an Access point - Don't know if this has any effect to the issue.

So what's next? Where do i go from here?

msj33
15-07-2008, 19:29
Does anyone have a solution on the above issue?

nsec
21-07-2008, 17:41
If I`m now using Transmission as a torrent client, is it necessarily to remove Transmission before installing rTorrent ?

When I installed Transmission I used Wengi`s instructions ( http://wl500g.info/showthread.php?t=10307 ). So if i want to setup rTorrent do I have to remove or modify something ?

Thanks !

nsec
22-07-2008, 13:57
If I`m now using Transmission as a torrent client, is it necessarily to remove Transmission before installing rTorrent ?

When I installed Transmission I used Wengi`s instructions ( http://wl500g.info/showthread.php?t=10307 ). So if i want to setup rTorrent do I have to remove or modify something ?

Thanks !

Somebody ? Help :(

gouryella
23-07-2008, 13:56
Hi!

I followed gouryella's "how to", And managed to make it run, but now, when I put something to download it says Timeout was Reached.
How can I fix that...
I'm a totally newbie when it comes to linux...
Pls HELP!

Mayby problem with firewall, there is code working for me



#!/bin/sh
#for webserver ftp ssh
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 81 -j ACCEPT
#iptables -A INPUT -p tcp --dport censored -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT

#for amule
iptables -A INPUT -p tcp --dport 4662 -j ACCEPT
iptables -A INPUT -p udp --dport 4672 -j ACCEPT
iptables -A INPUT -p udp --dport 4665+3 -j ACCEPT

#for rtorrent ?
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport 10000:11000 -j ACCEPT

#webserver prerouting
iptables -t nat -A PREROUTING -i $1 -p tcp --dport 80 -j DNAT --to-destination $4:81

#for rtorrent ?
for P in 10000:11000; do
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT
done

iptables -A INPUT -j DROP

fukazzz
23-07-2008, 15:44
I followed gouryella's instructions and everything is wokring! that's cool. What I did, is that I renamed S99rtorrent to S99rtorrent.old, made chmod -x S99rtorrent.old and created in /opt/etc/init.d/S99rtorrent with gouryella's contents. I also made chmod +x to it. My problem - it does not start automatically after reboot. I have to do sh /opt/etc/init.d/S99rtorrent :( It's quite not good, so what is the problem? As I said, I put an execution flag to it, why doesn't it start itselfe?

darkside40
24-07-2008, 20:41
Has anybody already tried to get rtorrent working with rTWi on the 500gP?

wirespot
24-07-2008, 22:31
I know it works with rtGui. But I'm not sure you'll get either of them to work on the router, I don't think the PHP there has xmlrpc in it (and I'm not keen on running PHP at all on the router, it's too damn heavy.)

What I did is have lighttpd on the router do RPC with the rtorrent RPC socket, and installed rtGui on my PC, where I have an Apache and PHP with xmlrpc. Makes sense, since I need my PC on anyway whenever I wanna check out rtorrent. Then again, if you want to be able to do this from outside your LAN... you're pretty much out of luck if the PHP on the router really doesn't have xmlrpc.

On a side note, I think rtGui looks better. :)

cupacup
24-07-2008, 23:12
Hello i had found this web client (http://wl500g.info/showthread.php?p=99824) and it works great especially with Prism. http://shrani.si/f/3q/12A/4fdz3AZW/rtorrent.png

darkside40
25-07-2008, 16:03
So i installed rTWi just now on my 500gP, if you combine this HowTo and the instructions from the rTWi Homepage it is no problem.

It also works with only the scgi_port instruction, no need for RPC2 or something like that.

It doesnt look that pretty, but what is more important to me, is that it runs very smooth on the Hardware.

bigphantom
25-07-2008, 22:23
i tried this just few minutes ago, seems i cannot find rtorrent package; Any ideeas ?
firmware 1.9.2.7-7g



[admn@(none) root]$ ipkg update
Downloading http://wl500g.dyndns.org/ipkg/Packages
Updated list of available packages in /opt/lib/ipkg/lists/wl500g
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/Packages
Updated list of available packages in /opt/lib/ipkg/lists/unslung
Successfully terminated.




[admn@(none) root]$ ipkg install rtorrent
Nothing to be done
An error ocurred, return value: 4.
Collected errors:
Cannot find package rtorrent.
Check the spelling or perhaps run 'ipkg update'

gouryella
27-07-2008, 12:08
i tried this just few minutes ago, seems i cannot find rtorrent package; Any ideeas ?
firmware 1.9.2.7-7g


try:

ipkg install ipkg-opt
I have ipkg-opt - 0.99.163-10 - The Itsy Package Manager on 1.9.2.7-10 (http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/Packages.gz)

if do not work (this is from wengi guide): http://wl500g.info/showthread.php?t=10307

wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-10_mipsel.ipk
ipkg.sh install ipkg-opt_0.99.163-10_mipsel.ipk
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-13_mipsel.ipk
ipkg.sh install uclibc-opt_0.9.28-13_mipsel.ipk
ipkg update


ipkg update
ipkg upgrade

bigphantom
27-07-2008, 22:14
thanks gouryella

i've finally succeded,

just a quick summary

in 1.9.2.7-7 firmware, because i guess ipkg.conf file had no available links to ipkg packages i could not intall rtorrent.

upgraded to 1.9.2.7-10 firmware, (tried to mantain config of my flash usb) the i could not intalled the ipkg-opt package indicated only forcing it, and then rtorrent went straight through, using p2p user, no automatic startup (yet) , firewall etc ...

i've noted down, everythinhg i did so i could post later on an updated version of the tutorial.

i get this error, but rtorrent works, (it downloads and uploads), i have no ideea why, and nor had i understood the previous explanation for this case


[admin@asusbox root]$ sh /opt/etc/init.d/S99rtorrent
[: missing argument after `RTORRENT_DEFAULT'
[: missing argument after `RTORRENT_DEFAULT'
[: missing argument after `RTORRENT_DEFAULT'
Usage: /etc/init.d/rtorrent {start|stop|restart|force-reload}


i would like to start rtorrent automatically, but i yet was a=unable to understand some points from here (http://wl500g.info/showpost.php?p=66875), and not knowing where to post, i post here:

Q1.- that big code has to entirely replace my S99rtorrent ?

Q2.- regarding base="/opt/home/torrent", i've setup my download folder as /opt/ext2/torr (/opt/ext2 -is the mount place of my hdd); Should i change it with mine ?

Q3. regarding config="/opt/home/${user}/.rtorrent.rc"
i have troubles understanding if i should leave it like this, or i should change it to something else. ($user being what ?)

Q4. (and final one)

Add the following lines to ~/.profile:

alias rt='su -c "screen -r" p2p'
chmod a+rw `tty`
stty start undef
stty stop undef

till now, everything i have in my profile file, is put in my /opt/etc/profile, see below; What does ~/.profile mean ? should i put that line in the file at this address /opt/etc/profile, or not ?


export TERMINFO=/opt/share/terminfo
alias mc="mc -c"

alias savereboot="flashfs save && flashfs commit && flashfs enable && reboot"

# Make ls default -la with color coding
alias ls="ls --color=auto -la"

# Make pss a grep ps function
alias pss="ps axf | grep"

# df human readable (Only works with coreutils installed!)
alias df="df -h"

# To start nload with DSL 6000 settings: 'nld'
#alias nld="nload -t 200 -s 7 -i 6656 -o 640 -u H eth1"

#added for rtorrent
alias rt='su -c "screen -r" p2p'
chmod a+rw `tty`
stty start undef
stty stop undef

darkside40
28-07-2008, 11:31
Is the stop_on_ratio setting working for you?

In my /opt/etc/rtorrent.conf i have the line stop_on_ratio = 120 but this morning i recognized that there was a torrent with a ratio over 2,2 and still seeding?

So it seems that this command was not recognized by the client.

Edit:
The stop_on_ration command like it is showed all pver the Thread is simply wrong. It has to be combined with a scheduler Task, like it is explained in the sample rtorrent.conf.

msj33
30-07-2008, 18:36
Can someone please just post a WORKING guide from start to end!

The existing guide must be OUT-OF-DATE, because I(and others) keep getting Time-out issue!

I tried to sum up what everyone has written in this thread, and sofar i got nowhere.

I'm getting annoyed in using Enhanced Torrent, because its SO buggy!

Please help, thanks

/Morten

cupacup
01-08-2008, 19:34
Everyone says, that its a firewall issue - but where? I opened both ports in IPTABLES and my Modem/router.

My ASUS is NOT setup like a router - Only as an Access point - Don't know if this has any effect to the issue.

Are you sure you also forwarded ports on internal router to you access point. Opening port on your router will not work , for other devices behind router.

msj33
01-08-2008, 20:03
cupacup> Yes I portforwarded port 10000-11000 to 192.168.1.10 which is my ASUS - Then furthermore did the IPTABLES changes as suggested in the guide.

Can someone working post:
Guide

or

Firmware version
Rtorrent/Libtorrent versions
etc.

Thanks

/Morten

msj33
01-08-2008, 21:54
Whooooo.........somehow i got it working!!?!?!?

I don't know how, but i would guess, that it is cause by a update.

I did a "ipkg update" and afterwardx a "ipkg upgrade" and then did gouryella's setup again and everything is working fine now - no longer timeout issue.

Thanks goes out to the ones who tried to help me out:)

/Morten

dclagoa
14-08-2008, 11:16
Hi everyone, ¿Is there any way to get rtorrent to exit automatically when all the torrents are finished or had been deleted?

ecori
29-09-2008, 20:33
Hi guys,
I got rtorrent running, and I like it alot. The possibilities automatization are great. However, I still got an error when downloading for some time. I got the message: file chunk read error: cannot allocate memory. I tried to figure out what was going on, and noticed an option called max_memory_usage (see http://libtorrent.rakshasa.no/wiki/RTorrentPerformanceTuning). I have tried using several values (at the moment 105306368), but still the error message pops up all the time. How did you solve this issue?
Thanks for thinking with me,
Ecori

ebabinski
05-10-2008, 18:18
Hello, could anybody post an upgraded/updated howto of installing the rtorrent?

I've tried countless times to make this work but I could not see the process in the ps axf.

I tried manually running rtorrent and I get that .rc file could not be found.

Here's my ipkg list_installed


adduser - 1.10.3-1 - a multi-call binary for login and user account administration
coreutils - 6.12-2 - Bunch of heavyweight *nix core utilities
cron - 4.1-7 - Standard vixie cron, with cron.d addition
diffutils - 2.8.1-6 - contains gnu diff, cmp, sdiff and diff3 to display differences between and among text files
dtach - 0.8-1 - A program that emulates the detach feature of screen.
e2fslibs - 1.41.1-1 - Ext2 Filesystem Libraries
e2fsprogs - 1.41.1-1 - Ext2 Filesystem Utilities
expat - 2.0.1-1 - XML Parser library
findutils - 4.2.32-1 - File finding utilities
fontconfig - 2.5.0-0 - Font configuration library
freetype - 2.3.6-1 - Free truetype library
gconv-modules - 2.2.5-7 - Provides gconv modules missing from the firmware. These are used by glibc iconv() implementation.
glib - 2.12.13-1 - The GLib library of C routines.
groff - 1.19.2-2 - front-end for the groff document formatting system
hdparm - 8.9-1 - Linux hard drive parameter utility
ipkg-opt - 0.99.163-10 - The Itsy Package Manager
less - 418-1 - Less file browser
libcurl - 7.19.0-2 - Curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FI
libgd - 2.0.35-2 - An ANSI C library for the dynamic creation of images
libjpeg - 6b-2 - collection of jpeg tools
libpng - 1.2.32-1 - Portable Network Graphics Libraries
libsigc++ - 2.0.18-1 - libsigc++ implements a typesafe callback system for standard C++.
libtorrent - 0.12.3-1 - libtorrent is a BitTorrent library with a focus on high performance and good code.
libuclibc++ - 0.2.2-8 - C++ standard library designed for use in embedded systems
libxml2 - 2.7.1-1 - Libxml2 is the XML C parser and toolkit developed for the Gnome project.
man - 1.6f-1 - unix manual page reader
man-pages - 2.76-1 - unix manual pages
mc - 4.6.1-3 - Midnight Commander File Manager
nano - 2.1.5-1 - A pico like editor
ncurses - 5.6-3 - NCurses libraries
ncursesw - 5.6-2 - NCurses libraries with wide char support.
openssl - 0.9.7m-4 - Openssl provides the ssl implementation in libraries libcrypto and libssl, and is needed by many other applications and librari
pcre - 7.8-1 - Perl-compatible regular expression library
popt - 1.14-1 - A C library for parsing command line parameters.
procps - 3.2.7-6 - PROCPS System Utilities
readline - 5.2-2 - The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are
rtorrent - 0.8.3-1 - rtorrent is a BitTorrent client for ncurses, using the libtorrent library.
screen - 4.0.3-2 - A screen manager that supports multiple logins on single terminal
slang - 2.1.4-1 - S-Lang is a multi-platform library designed to allow a developer to create robust multi-platform software.
termcap - 1.3.1-2 - Terminal emulation library
uclibc-opt - 0.9.28-13 - micro C library for embedded Linux systems
unzip - 5.52-3 - A (de)compression library for the ZIP format
xmlrpc-c - 1.11.00-3 - A library providing modular implementation of XML-RPC for C and C++.
zlib - 1.2.3-3 - zlib is a library implementing the 'deflate' compression system.


and my ps axf for reference


PID TTY STAT TIME COMMAND
1 ? S 0:01 /sbin/init
2 ? S 0:00 [keventd]
3 ? SN 0:00 [ksoftirqd_CPU0]
4 ? S 0:00 [kswapd]
5 ? S 0:00 [bdflush]
6 ? S 0:00 [kupdated]
7 ? S 0:00 [mtdblockd]
57 ? S 0:00 telnetd
506 pts/0 Ss 0:00 \_ -sh
522 pts/0 R+ 0:00 \_ ps axf
62 ? S 0:00 httpd vlan1
68 ? S 0:00 klogd
73 ? S 0:00 [dnsmasq]
75 ? S 0:00 [khubd]
85 ? Ss 0:00 lpd
87 ? Ss 0:00 p9100d -f /dev/usb/lp0 0
90 ? Ss 0:00 waveservermain
92 ? Ss 0:00 rcamdmain
96 ? S 0:00 [usb-storage-0]
97 ? S 0:00 [scsi_eh_0]
113 ? S 0:00 udhcpc -i vlan1 -p /var/run/udhcpc0.pid -s /tmp/udhcp
114 ? Ss 0:00 pppd file /tmp/ppp/options.wan0
116 ? Ss 0:00 infosvr br0
117 ? Ss 0:00 watchdog
120 ? Ss 0:00 \_ ntp
127 ? S 0:00 dropbear
146 ? S 0:00 [kjournald]
147 ? S 0:00 [kjournald]
174 ? S 0:00 /sbin/syslogd -m 0 -O /opt/var/log/syslog.log -S -l 7
179 ? Ss 0:00 /opt/sbin/cron
213 ? S 0:00 upnp -D -L br0 -W ppp0
495 ? Ss 0:00 [screen]
499 pts/1 Ss+ 0:00 \_ /bin/sh


As you can see, there is no sign of rtorrent.

I'm using oleg's 1.9.2.7-10 firmware
Any help is much appreciated.

ecori
05-10-2008, 20:39
Hi,
rtorrent runs great on my asus. I had some memory problems initially, but with the latest release that seems to be fixed. I installed rtorrent as described at the beginning of this thread, however I did not use lighttpd. After installation of rtorrent (be sure also libTorrent is installed, but that is present on your list), I edited the startup script at only 2 positions:

nano -w /opt/etc/init.d/S99rtorrent
then at the beginning make a change:

dirlayout=RTORRENT_Custom
(if you don't, you will get an error message)
A littlebit further in the file you will find user=

user="admin" (or other name, that you use to login onto your router)

Be sure it is executable:

chmod +x /opt/etc/init.d/S99rtorrent

These settings should take care for rtorrent to find its config file (located in /opt/etc/rtorrent.conf)

Next I edited rtorrent.conf using:

nano -w /opt/etc/rtorrent.conf


# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
scgi_port = 127.0.0.1:5000
# Minumum amount of peers to connect per torrent, if available.
min_peers = 20

# Minumum amount of peers to connect per torrent.
max_peers = 40

# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 20

# Maximum number of simultanious uploads per torrent.
max_uploads = 5

#max_uploads_global = 20
#max_downloads_global = 30

#max_open_http = 10
#max_open_sockets = 128
#max_open_files = 256

# Global download rate in KiB. "0" for unlimited.
download_rate = 800

# Global upload rate in KiB. "0" for unlimited.
upload_rate = 800

# Default directory to save downloaded files. Note it doesn't support
# space yet.
#directory = /opt/share/torrent/work/
directory = /tmp/mnt/disc0_3/torrent/work

# Watch a directory for new torrents, and stop those that have been deleted.
#schedule = watch_directory,5,5,load_start=/opt/share/torrent/dl/*.torrent
#schedule = untied_directory,5,5,stop_untied
schedule = watch_directory,5,5,load_start=/tmp/mnt/disc0_3/torrent/source/*.torrent
schedule = untied_directory,5,5,stop_untied=
schedule = untied_directory,5,5,close_untied=
schedule = untied_directory,5,5,remove_untied=




# Close torrents when diskspace is low.
on_finished = move_complete,"execute=mv,$d.get_base_path=,/tmp/mnt/disc0_3/torrent/target;d.set_directory=/tmp/mnt/disc0_3/torrent/target"
schedule = watch_directory,10,10,"load_start=/tmp/mnt/disc0_3/torrent/source/*.torrent,d.set_custom2=1"
on_finished = set_done_var,d.set_custom2=
on_erase = rm_files,"branch=d.get_custom2=,\"execute={rm,-rf,--,$d.get_base_path=}\""

schedule = low_diskspace,5,60,close_low_diskspace=10000M

# Default session directory. Make sure you don't run multiple instance of rtorrent using the same session directory. Perhaps
#using a relative path? session = /opt/share/torrent/session
session = /tmp/mnt/disc0_3/torrent/session


# The ip address reported to the tracker.
#ip = rakshasa

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = rakshasa

# Port range to use for listening.
port_range = 51777-51780

# Start opening ports at a random position within the port range.
#port_random = no

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = no

# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
hash_read_ahead = 5

# Interval between attempts to check the hash, in milliseconds.
hash_interval = 10

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
hash_max_tries = 3

safe_sync=yes

# Max number of files to keep open simultaniously.
#max_open_files = 128

# Number of sockets to simultaneously keep open.
#max_open_sockets = <no default>


# Example of scheduling commands: Switch between two ip's every 5
# seconds.
#schedule = "ip_tick1,5,10,ip=torretta"
#schedule = "ip_tick2,10,10,ip=lampedusa"

# Remove a scheduled event.
#schedule_remove = "ip_tick1"

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"
#schedule = ratio,30,60,stop_on_ratio=200
schedule = ratio,60,60,"stop_on_ratio=110,50M,300"

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry,prefer_plaintext

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
dht = auto

# UDP port to use for DHT.
#
dht_port = 52000

# Enable peer exchange (for torrents not marked private)
#
peer_exchange = yes

#
# Do not modify the following parameters unless you know what you're doing.
#




And you should open up some ports in your firewall:

nano -w /usr/local/sbin/post-firewall
add lines:


# Allow access rtorrent

iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 51777:51780 -j ACCEPT
iptables -I INPUT 1 -p udp -i "$1" --dport 52000 -j ACCEPT


Now download ntorrent from
http://code.google.com/p/ntorrent/
install somewhere on your pc,
connect to your rtorrentsession choosing SSH, give the host adress (ip of your router) and login data. The great thing about ntorrent is that you don't need to put additional crap on your router. I tried it with lighttpd and a website user interface (like webtorrent or so), but I think ntorrent is more reliable.

In my setup I have the impression it runs better than transmission, after a couple of days it still downloads at full speed:D, and in contrast of transmission, it remains responsive. Also, it starts automatically torrents found in the source directory, after finishing the torrents it starts seeding until a certain ratio is achieved (in my case set to 1.1). There are even more options which you can find here:
(http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks#Movecompletedtorrents)

I hope this is helpful for you,
good luck,
Ecori

ebabinski
06-10-2008, 16:31
ecori...

You are my savior!!! Your howto worked!! I'm downloading at full speed now!

Thank you very much!!

ecori
06-10-2008, 16:46
You're welcome, nice to hear that it works for you too. I tried rtorrent while also transmission was installed. It appeared to me, that rtorrent was running better. So, also for others who would like to try, just give it a shot!

ebabinski
09-10-2008, 06:34
Tried transmission. The fastest speed I got was 2 kbps. LOL.

This procedure by ecori would also load rtorrent on startup. no need to type the console command every time you restart :D

spigot
16-10-2008, 09:25
Hello.
I installed rtorrent and did all configuration, but i still can't download. Every time I start torrent downloading I get "Closed torrents due to low disk space" error, but my disk is empty?
Any suggestion?
Thanks.

ecori
16-10-2008, 09:36
Hi Spigot,
I don't recognize your error, however I can imagine that this would happen if rtorrent thinks that there would not be enough free space on your harddrive. Perhaps you could try to change inactivate the rule:
schedule = low_diskspace,5,60,close_low_diskspace=10000M
by adding a # in front of the line, ie.


# schedule = low_diskspace,5,60,close_low_diskspace=10000M

spigot
16-10-2008, 10:06
Hi ecori,
thank you for your help.
That was first thing I did, but without any change. Torrent starts and then stops with this message.

ecori
16-10-2008, 10:19
Fat32 format of the harddisk?
Try small torrents....

spigot
16-10-2008, 10:26
No, ext3. I'll try and let you know.

spigot
16-10-2008, 16:25
Hi.
I figured out strange thing. When I start download, rtorrent says "Closed torrents due to low disk space error" as before. But after a while it finishes download, but the message stays (I know it because the downloaded file transfers from "work" directory to "target" directory and the file works).
But rtorrent shows only the message without downloading progress????
Edit: I tried nTorrent an it works :)) I'm very happy. But I still don't understand the rtorrent's behaviour?

spigot
16-10-2008, 19:40
Hi.
Another problem. I'm unable to get full download speed. I have about 20Kb/s per torrent and see max 15 seeders (trackers show 10223 seeders and more). I did all firewall configuration but without any success.
And DHT shows nothing: 0 Seeders 0 Leechers, Last time: null.
My rtorrent.conf:


#This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
scgi_port = 127.0.0.1:5000
# Minumum amount of peers to connect per torrent, if available.
min_peers = 20

# Minumum amount of peers to connect per torrent.
max_peers = 40

# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 20

# Maximum number of simultanious uploads per torrent.
max_uploads = 5

#max_uploads_global = 10
#max_downloads_global = 30

#max_open_http = 10
#max_open_sockets = 128
#max_open_files = 256

# Global download rate in KiB. "0" for unlimited.
download_rate = 0

# Global upload rate in KiB. "0" for unlimited.
upload_rate = 12

# Default directory to save downloaded files. Note it doesn't support
# space yet.
#directory = /opt/share/torrent/work/
directory = /tmp/mnt/disc0_3/torrent/work

# Watch a directory for new torrents, and stop those that have been deleted.
#schedule = watch_directory,5,5,load_start=/opt/share/torrent/dl/*.torrent
#schedule = untied_directory,5,5,stop_untied
schedule = watch_directory,5,5,load_start=/tmp/mnt/disc0_3/torrent/source/*.torrent
schedule = untied_directory,5,5,stop_untied=
schedule = untied_directory,5,5,close_untied=
schedule = untied_directory,5,5,remove_untied=




# Close torrents when diskspace is low.
on_finished = move_complete,"execute=mv,$d.get_base_path=,/tmp/mnt/disc0_3/torrent/target;d.set_directory=/tmp/mnt/disc0_3/torrent/target"
schedule = watch_directory,10,10,"load_start=/tmp/mnt/disc0_3/torrent/source/*.torrent,d.set_custom2=1"
on_finished = set_done_var,d.set_custom2=
on_erase = rm_files,"branch=d.get_custom2=,\"execute={rm,-rf,--,$d.get_base_path=}\""

#schedule = low_diskspace,5,60,close_low_diskspace=1M

# Default session directory. Make sure you don't run multiple instance of rtorrent using the same session directory. Perhaps
#using a relative path? session = /opt/share/torrent/session
session = /tmp/mnt/disc0_3/torrent/session


# The ip address reported to the tracker.
#ip = rakshasa

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = rakshasa

# Port range to use for listening.
port_range = 51777-51780

# Start opening ports at a random position within the port range.
#port_random = no

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = no

# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
hash_read_ahead = 5

# Interval between attempts to check the hash, in milliseconds.
hash_interval = 10

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
hash_max_tries = 3

safe_sync=yes

# Max number of files to keep open simultaniously.
#max_open_files = 128

# Number of sockets to simultaneously keep open.
#max_open_sockets = <no default>


# Example of scheduling commands: Switch between two ip's every 5
# seconds.
#schedule = "ip_tick1,5,10,ip=torretta"
#schedule = "ip_tick2,10,10,ip=lampedusa"

# Remove a scheduled event.
#schedule_remove = "ip_tick1"

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"
#schedule = ratio,30,60,stop_on_ratio=200
schedule = ratio,60,60,"stop_on_ratio=110,50M,300"

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry,prefer_plaintext

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
dht = on

# UDP port to use for DHT.
#
dht_port = 6881

# Enable peer exchange (for torrents not marked private)
#
peer_exchange = yes

#
# Do not modify the following parameters unless you know what you're doing.
#

Any help?

koper89
20-10-2008, 09:32
It's working but often i have this problem
http://wl500g.info/showthread.php?p=116096#post116096
please help!!

i found something in russian but i don't understand anything could somebody translate it ??
http://wl500g.info/showthread.php?t=14256

lourenco
06-11-2008, 15:55
Finally got rtorrent working! It seems lighter than transmission.
Still, I'm having two problems - dunno if are related or not.

First I cant get more than 404 error with /RPC2 webserver (http://192.168.0.2:8082/RPC2, I have headstartII 'installed' for simplicity)

But the most annoying it that I can't get rtorrent runing on the background.
I have to manually start rtorrent and if I quit or close the SSH session (putty) it stops torrenting (seeding/downloadin). shouldn't it start auto on system reboot/restart?

I haven't figure it out why... please, help!


Edit: forgot to mention that ntorrent doesn't connect unless rtorrent is started manually and (ssh) open.

sass
16-12-2008, 19:14
hello

rtorrent & ntorrent are now working fine, but have one question:
is there an easy way to quickly change my global download and upload rate?
i've limited the rate in my rtorrent.conf file. suppose I go somewhere for an hour or so and want to set my rate at full speed at meantime. what would be the easyest way to do it without manually editing rtorrent.conf file?

darkside40
16-12-2008, 19:57
You can do it on the terminal when you are connected via ssh.

Just use the commands listet here (http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide) under "Throtteling".

Hope that helps.

sass
16-12-2008, 22:45
he he, I know, how to connect via ssh, but how do i enter then rtorrent?

darkside40
16-12-2008, 22:54
screen -r rtorrent does it for me

sass
16-12-2008, 23:25
if i put

schedule = Test,12:05:00,24:00:00,download_rate = 25
in my /opt/etc/rtorrent.conf file, the rtorrent doens't start. what's wrong?

ecori
18-12-2008, 08:21
if i put

schedule = Test,12:05:00,24:00:00,download_rate = 25
in my /opt/etc/rtorrent.conf file, the rtorrent doens't start. what's wrong?

I just followed the instructions according to http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks#Schedulingdownloadrate,
so the command should look something like

schedule = throttle_1,12:05:00,24:00:00,download_rate=25
schedule = throttle_2,24:00:00,12:05:00,download_rate=0


Notice that seeding rules have changed in the latest version of rtorrent. I now use:


# Enable the default ratio group.
ratio.enable=

# Change the limits, the defaults should be sufficient.
ratio.min.set=100
ratio.max.set=110
ratio.upload.set=20M


Regards,
Ecori