Setup of SCGI port

somus1735

Member
May 25, 2018
833
0
16
Hi everyone,

I'm tring to install rutorrent 2.8 on my Debian Lenny.

I have the following error while trying to connect rtorrent:
Quote
[...] 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.
[...] Bad response: (500) <?xml version="1.0" encoding="iso-8859-1"?
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>500 -
Internal Server Error</title> </head> <body> <h1>500 - Internal Server Error</h1>
</body> </html>​


I understand it is due to the setup of my SCGI ports but i really don't understand how to set them up correctly on my Apache server.

Thanks for your answers,
 

shwetha17

Member
May 24, 2018
785
0
16
do you have mod_scgi installed?
on debian i THINK it is:

Code:
apt-get install libapache2-mod-scgi
without this module, you can't do it. Unless of course you use the RPC plugin. That negates the need for mod-scgi but it's not as fast in my opinion


also, if you read my guides, i explain how it works.

This is what is important:


rtorrent compiled with xmlrpc-c (IMPORTANT NOTE: This is almost NEVER done in the packages, meaning you will HAVE to compile it yourself, and you SHOULD use a version of xmlrpc-c 1.11 or greater, i highly recommend svn version, google xmlrpc-c and click download, then look at GET FROM SVN)

a web server with a SCGI module. This comes with lighttpd out the box (but must be enabled), it comes with cherokee out the box (but must be configured) With apache, you must install it, but apache probably has the easiest config

a unix user to run rtorrent, with a .rtorrent.rc in his home dir, in this file you should have a line like this:
Code:
scgi_port = 127.0.0.1:5000
then in the rutorrent files, make sure your config file matches the port, in 2.8 there are 2 files, rutorrent/conf.php and rutorrent/rs.js

conf.php has the port/address, rs.js has the /RPC2 or whatever mount point you specified as the scgi gateway in your web server
 

das329717

Member
May 25, 2018
928
0
16
Few steps & things to do, to get it working :

apt-get install libapache2-mod-scgi

sudo cp /etc/apache2/mods-available/scgi.load /etc/apache2/mods-enabled/scgi.load

Modify Apache

at the end of your apache config fill in :
SCGIMount /RPC1 127.0.0.1:5001
SCGIMount /RPC2 127.0.0.1:5002
SCGIMount /RPC3 127.0.0.1:5003

You should also secure it ... so it prevents other people without a pw to look at the torrents
 

somus1735

Member
May 25, 2018
833
0
16
Hi,

I don't really understand, i think I did everything you preconized but i still have the same issue.

I setup scgi and xmlrpc as described in the documentation: http://code.google.com/p/rutorrent/wiki/Main
I'll try to recompile xmlrpc in case i missed something.

my 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) Gecko/2008052906 Firefox/3.0&#39;);
define(&#39;HTTP_TIME_OUT&#39;, 30);
define(&#39;HTTP_USE_GZIP&#39;, true);

define(&#39;RPC_TIME_OUT&#39;, 15); // in seconds
define(&#39;DO_DIAGNOSTIC&#39;, true);

$uploads = &#39;./torrents&#39;; // temp directory for uploaded torrents, without tail slash
$settings = &#39;./settings&#39;; // settings directory, without tail slash
$log_file = &#39;/tmp/errors.log&#39;; // path to log file (comment or make empty to disable logging)

$scgi_port = 5000;
$scgi_host = "127.0.0.1";

$pathToPHP = &#39;&#39;; // Something like /bin/php. If empty, will be founded in PATH.
$pathToCurl = &#39;&#39;; // Something like /bin/curl. If empty, will be founded in PATH.

// 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";
?>
rs.js:
Code:
var WUIResorces =
{
XMLRPCMountPoint : "/RPC2",
AddTorrentURL : "addtorrent.php",
SetSettingsURL : "setsettings.php",
GetSettingsURL : "getsettings.php",
GetPlugingURL : "getplugins.php",
RIPEURL : "http://www.db.ripe.net/whois?alt_database=ALL&form_type=advanced&searchtext="
};note that the directory ..../rutorrent/RPC2 does not exists. I don't really understand where it is mounted.

etc/apache2/apache2.conf (truncated)
Code:
#...
# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/


SCGIMount /RPC2 127.0.0.1:5000
SCGIMount /RPC1 127.0.0.1:5001
SCGIMount /RPC2 127.0.0.1:5002
SCGIMount /RPC3 127.0.0.1:5003
 

shwetha17

Member
May 24, 2018
785
0
16
Quote
Hi,

I don't really understand, i think I did everything you preconized but i still have the same issue.

I setup scgi and xmlrpc as described in the documentation: http://code.google.com/p/rutorrent/wiki/Main
I'll try to recompile xmlrpc in case i missed something.​


respectfully, you must have missed something.

Quote
my 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) Gecko/2008052906 Firefox/3.0&#39;);
define(&#39;HTTP_TIME_OUT&#39;, 30);
define(&#39;HTTP_USE_GZIP&#39;, true);

define(&#39;RPC_TIME_OUT&#39;, 15); // in seconds
define(&#39;DO_DIAGNOSTIC&#39;, true);

$uploads = &#39;./torrents&#39;; // temp directory for uploaded torrents, without tail slash
$settings = &#39;./settings&#39;; // settings directory, without tail slash
$log_file = &#39;/tmp/errors.log&#39;; // path to log file (comment or make empty to disable logging)

$scgi_port = 5000;
$scgi_host = "127.0.0.1";

$pathToPHP = &#39;&#39;; // Something like /bin/php. If empty, will be founded in PATH.
$pathToCurl = &#39;&#39;; // Something like /bin/curl. If empty, will be founded in PATH.

// 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";
?>
rs.js:
Code:
var WUIResorces =
{
XMLRPCMountPoint : "/RPC2",
AddTorrentURL : "addtorrent.php",
SetSettingsURL : "setsettings.php",
GetSettingsURL : "getsettings.php",
GetPlugingURL : "getplugins.php",
RIPEURL : "http://www.db.ripe.net/whois?alt_database=ALL&form_type=advanced&searchtext="
};​

note that the directory ..../rutorrent/RPC2 does not exists. I don't really understand where it is mounted.


That directory is a webdirectory. It won't actually exist. It is basically a mount point for the SCGI gateway which has 2 sides, one side is connected to rtorrent via the port, the other side is connected to the webserver via the scgi mount.

Quote
etc/apache2/apache2.conf (truncated)
Code:
#...
# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/


SCGIMount /RPC2 127.0.0.1:5000
SCGIMount /RPC1 127.0.0.1:5001
SCGIMount /RPC2 127.0.0.1:5002
SCGIMount /RPC3 127.0.0.1:5003​


you forgot something.

things to check:

.rtorrent.rc
do you have a line like this:

scgi_port = 127.0.0.0.1:5001

if so, when you start rtorrent, do you see "rtorrent started with xxx functions"

next, did you install mod_scgi for your webserver? It does NOT come with your webserver by default.

If so, make sure your rutorrent conf.php has the right port (the one set in .rtorrent.rc) and rs.js has the right mount point (the one set in your webserver)

if you can't figure it out, get the rpc plugin, it's idiot proof.