rtorrent connection problem

lisas4567

Member
May 25, 2018
773
0
16
I keep getting "Bad link to rTorrent. Check if it is really running. Check $scgi_port and $scgi_host settings in config.php and scgi_port in rTorrent configuration file." in my rutorrent log. Rutorrent and rtorrent both work, but no plugins are loaded. Once in a while rutorrent would load with plugins and no such message in the log. When this happens, some plugins may or may not be loaded. Does anyone know what i can do about this?

I set up r(u)torrent using this guide.

I get this using rutorrent 2.8 and 3.0 beta releases.
 

saroos1

Member
May 25, 2018
718
0
16
Hi vuce

I'm just going to provide some trouble shooting tips for you to "check"

1: On the server, is rtorrent running, you may have to login to check this
If it is running, is rtorrent, but reporting errors, then you will have to ensure scgi_port is configured in your .rtorrent.rc file, which is usually in your home folder as who you are
logged in as. ( eg. /home/someguy/.rtorrent.rc and the line will be scgi_port = localhost:5000 )

2: While logged in your server, go to you www servers directory (usually /var/www/ and then cd to /var/www/rutorrent/conf ) and launch the config.php file.
There is a section in the php file that asks for $scgi_port = must equal the port value, as indicated in your .rc file (5000) and the same goes with $scgi_host = localhost, or 127.0.0.1

4: Try loading a torrent via the console.

3: If you are running a headless server (aka no monitor, and you are doing everything via SSH, then you may need to install a program called screen. screen allows you to run a program, without having it on your current TTL .. By ending a SSH session without first putting rtorrent into screen mode, it ends end torrent..

To save space and time ... Try running rtorrent when you are logged into your SSH session, and then try to bring up the rutorrent site.
>> If that works, then try to end your ssh session, and refresh the website (you will find that rutorrent can't find rtorrent)

If this is the case, install screen ( aptitude update && aptitude install screen === if you are debian based [debian, ubuntu, etc]
once screen is installed, at the console prompt, type screen rtorrent <enter key> you will then see rtorrent load.

Now to "detach" the screen
At console on server:press <ctrl>+a and <ctrl>+d

To re-attached to the rtorrent window:
At console on server: screen -d -r

If nothing works, can you provide more information on your install like
Distribution Type:
 

lisas4567

Member
May 25, 2018
773
0
16
saroos1, thanks for the quick reply.

Quote
Hi vuce

I'm just going to provide some trouble shooting tips for you to "check"

1: On the server, is rtorrent running, you may have to login to check this
If it is running, is rtorrent, but reporting errors, then you will have to ensure scgi_port is configured in your .rtorrent.rc file, which is usually in your home folder as who you are
logged in as. ( eg. /home/someguy/.rtorrent.rc and the line will be scgi_port = localhost:5000 )
2: While logged in your server, go to you www servers directory (usually /var/www/ and then cd to /var/www/rutorrent/conf ) and launch the config.php file.
There is a section in the php file that asks for $scgi_port = must equal the port value, as indicated in your .rc file (5000) and the same goes with $scgi_host = localhost, or 127.0.0.1

4: Try loading a torrent via the console.

3: If you are running a headless server (aka no monitor, and you are doing everything via SSH, then you may need to install a program called screen. screen allows you to run a program, without having it on your current TTL .. By ending a SSH session without first putting rtorrent into screen mode, it ends end torrent..

To save space and time ... Try running rtorrent when you are logged into your SSH session, and then try to bring up the rutorrent site.
>> If that works, then try to end your ssh session, and refresh the website (you will find that rutorrent can't find rtorrent)

If this is the case, install screen ( aptitude update && aptitude install screen === if you are debian based [debian, ubuntu, etc]
once screen is installed, at the console prompt, type screen rtorrent <enter key> you will then see rtorrent load.

Now to "detach" the screen
At console on server:press <ctrl>+a and <ctrl>+d

To re-attached to the rtorrent window:
At console on server: screen -d -r

If nothing works, can you provide more information on your install like
Distribution Type:


1. rtorrent is definitely running and scgi_port is configured (127.0.0.1:5001).
2. all is well
4. loading over console works. Rtorrent works perfectly in every way.

The thing that's weird to me is that rutorrent (at least 2.cool.gif still works, even if it the error is there. The only difference being the plugins wouldn't load. With 3.0, everything would be disabled (since rutorrent seems to be getting smarter and figured out it "can't connect"). One thing that helps though is opening several instances of rutorrent and (probably?) overload the server. In that case rutorrent would (eventually) connect to rtorrent (but some plugins wouldn't load).

As for the install, i did everything EXACTLY the way it's explained in the guide. One thing i forgot to mention, i'm using freebsd 8.0 generic.
 

saroos1

Member
May 25, 2018
718
0
16
i'm sure you missed a step.

Which webserver are you using?

if you are using 2.8 post the config.php and the rs.js files allong with your .rtorrent.rc and webserver config.
 

lisas4567

Member
May 25, 2018
773
0
16
Quote
i'm sure you missed a step.​
Which webserver are you using?​
if you are using 2.8 post the config.php and the rs.js files allong with your .rtorrent.rc and webserver config.​


i didn't, i checked several times.
I'm not using 2.8 anymore, but i can post 3.0 configs, if that's of any help. (however i had the exact same problem using 2.8 )
I'm using Apache/2.2.13.

config.php
Code:
<?php
// configuration parameters

@define(&#39;HTTP_USER_AGENT&#39;, &#39;Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9)
@define(&#39;HTTP_TIME_OUT&#39;, 30, true); // in seconds
@define(&#39;HTTP_USE_GZIP&#39;, true, true);
@define(&#39;RPC_TIME_OUT&#39;, 15, true); // in seconds
@define(&#39;LOG_RPC_CALLS&#39;, false, true);
@define(&#39;LOG_RPC_FAULTS&#39;, true, true);

$do_diagnostic = true;
$log_file = &#39;/tmp/errors.log&#39;; // path to log file (comment or make empt
$saveUploadedTorrents = true;

$topDirectory = &#39;/&#39;; // Upper available directory. Absolute pa

$scgi_port = 5001;
$scgi_host = "127.0.0.1";
$XMLRPCMountPoint = "/RPC1";

$pathToPHP = &#39;&#39;; // Something like /bin/php. If empty, wil
$pathToCurl = &#39;&#39;; // Something like /bin/curl. If empty, wi

// For web->rtorrent link through unix domain socket
// (scgi_local in rtorrent conf file), change variables
// above to something like this:
//
// $scgi_port = 0;
// $scgi_host = "unix:///tmp/rpc.socket";

?>

.rtorrent.rc
Code:
# 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.

# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
#max_peers = 100

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

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

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 80
upload_rate = 20

# Default directory to save the downloaded torrents.
directory = /p2p/downloads

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/miha/rtorrent/.session/

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/p2p/watch/*.torrent
#schedule = untied_directory,5,5,stop_untied=

# Close torrents when diskspace is low.
#schedule = low_diskspace,5,60,close_low_diskspace=100M

# 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"

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

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

# Port range to use for listening.
#port_range = 6890-6999

# 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

# 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 = 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.
#

# 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 = 10

# 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 = 5

port_range = 10001-10001
dht_port = 25001
scgi_port = 127.0.0.1:5001

Includes/miha.conf
Code:
Alias /miha /usr/local/www/apache22/data/rutorrent-users/miha/
<Directory /usr/local/www/apache22/data/rutorrent-users/miha>
Options Indexes FollowSymLinks
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

SCGIMount /RPC1 127.0.0.1:5001
<Location /RPC1>
AuthName "Private"
AuthType Basic
AuthBasicProvider file
AuthUserFile /usr/local/www/private/.htpasswd
AuthGroupFile /usr/local/www/private/.htgroups
Require group miha
</Location>

Since everything works to some extent i don't believe settings are the problem.

(awesome guide btw, wonslung)
 

saroos1

Member
May 25, 2018
718
0
16
without looking at your configs, i can tell you that multi-user in 3.0 is entirely different and requires webserver authenitcation to be set up correctly.

I'll read over your configs in a minute, but i'm 100% sure you did something wrong. The reason i'm so sure is i've set up at LEAST 50 and maybe as many as 100 seedboxes, 95% on FreeBSD.

I will do everything in my power to get you up and running, including logging on and fixing it myself if i have to.

but first lets see what we can do via the forums.
 

saroos1

Member
May 25, 2018
718
0
16
first, check your

$pathToCurl = ';


that should have 2 ' marks not just one.

also, let's try this:


if you are using 3.0, make a new dir in conf/users/ for the user you wish to log in as. For instance, if you are logging in as HellaBig then do this:

mkdir conf/users/HellaBig/

from your rutorrent webroot.

then copy your config into that.

Also make sure your share/ folder in rutorrent's files is chown'd to www:www or chmod'd to 777



also, if you're using 3.0, read over this: http://forums.rutorrent.org/index.php?topic=87.0

because with 3.0 you dont' need to bother with alias's and multiple locations for rutorrent's files.

you set a single dir (webroot is fine) and set up multiple users via conf/users/$USERNAME/ then copy the conf.php into that dir for each user, changing the setttings.

you may also want to set your php and curl binary locations, in freebsd it's

/usr/local/bin/curl
/usr/local/bin/php
 

lisas4567

Member
May 25, 2018
773
0
16
Ok, i deleted the previous setup and started over from scratch, however i'm not sure how to "link" webserver authentication to rutorrent using conf files in different users' directories.
My guess was something like this

Code:
Alias /rtorrent /usr/local/www/apache22/data/3.0/rutorrent/
<Directory /usr/local/www/apache22/data/3.0/rutorrent/>
Options Indexes FollowSymLinks
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

SCGIMount /RPC1 127.0.0.1:5001
<Location /RPC1>
AuthName "Private"
AuthType Basic
AuthBasicProvider file
AuthUserFile /usr/local/www/private/.htpasswd
AuthGroupFile /usr/local/www/private/.htgroups
</Location>

but it (obviously) won't work.

edit: I found out the way i had it set up previously rutorrent connected to rtorrent whenever i got prompted for username/password, but this wouldn't happen every time...
 

peshua19

Member
May 25, 2018
897
0
16
Quote
Rutorrent and rtorrent both work, but no plugins are loaded.​

ruTorrent use two ways for connect with rTorrent - via rpc mount point for js part, and via direct scgi_port:scgi_host for php part. First way is worked for you, e.q. your mount point is configured by the right way. But second is not worked - check, what it already say to you - "Check $scgi_port and $scgi_host settings in config.php and scgi_port in rTorrent configuration file."
 

saroos1

Member
May 25, 2018
718
0
16
email me at [email protected] with your server details and i'll get it up for you. I'm not sure what you're doing wrong but i can get it up and running in 10 minutes provided rtorrent is compiled with xmlrpc.