NOTE: I will be re-writing this in the next day or so. Also be on the lookout for os specific guides.
This will explain the basic concepts behind rutorrent multi-user support.
It's important to note that this multiple user support STILL requires multiple rtorrent clients (one for each user) running on multiple scgi mounts. The only thing this new feature does is somewhat simplify setting up multiple users and allow you to run with a single domain.
It's also important to note that some form of authentication in your webserver is an integral part of this new multiple user setup and without authentication, this mod doesn't work. If you want multiple users without authentication then you need to user mutliple rutorrent directories as per the old method.
First, you need to create mutliple unix users. Each unix is different in this respect, and most have multiple methods of doing this, so seek out your specific documentation for how to do this.
once you have multiple users, you'll want to create a .rtorrent.rc for each user. you can use relative paths for stuff making the download directory and session directory easier to set up, but how you do this is really up to you. What is important here is that the FOLLOWING things are different in your .rtorrent.rc:
port for rtorrent (or range if you use a range, though you can get away with a single port in rtorrent for each user by doing something like this:
Code:
port_range = 51000-51000
scgi port
Code:
scgi_port = 127.0.0.1:5001
and if you use a dht port, this should be different as well. If you wish to make other settings you can, like i said, this is mainly up to you and i'd refer to rtorrent documentation for this.
once you have this, you'll want to set up multiple scgi mounts in your webserver...if you've installed rutorrent before then you know how to do this, it is different for ALL webservers, but what is important is that you have one mount for EACH user. The port should match whatever you set in the users .rtorrent.rc
you should also be sure to set up basic authentication. Your best bet is to put this on the web root which rutorrent will be run from. Set one username/password for each user. Again, this will varry from server to server so seek out your documentation.
now, you just need to get the rutorrent files. currently, the only method of downloading the rutorrent files for 3.0 is via svn so install subversion on your system and use the following command:
Code:
svn checkout http://rutorrent.googlecode.com/svn/branches/3.0/
this will download all the rutorrent 3.0 files AND all the rutorrent 3.0 plugins. Then, what you need to do is remove the rpc plugin, remove darkpal if you think it's as ugly as i do, and any other plugin you don't wish to use. This would look like this provided you JUST finished downloading via svn:
Code:
cd 3.0
rm -r plugins/rpc plugins/darkpal rutorrent/plugins
mv plugins/ rutorrent/
now you need to change some permissions or ownership. lets assume your webserver is owned by user www, you could do the following:
Code:
cd rutorrent/
chown -R www:www share/
if you don't know your webuser's name, just use chmod 777 instead like this:
Code:
cd rutorrent/
chmod -r 777 share/
now, you need to add a directory for each user in the conf/users/ directory and copy the config files for each into that dir, then edit each accordingly.
We're going to pretend you set up 4 users
user1 = wonslung and his SCGI mount is on /RPC1 and port 5001 (he's the coolest user you have)
user2 = jeff and his SCGI mount is on /RPC2 and port 5002
user3 = snott and his SCGI mount is on /RPC3 and port 5003
user4 = booger and his SCGI mount is on /RPC3 and port 5004
get the idea?
ok
so you're probabaly still in the rutorrent directory, this is good....we want to change to the conf dir and make some user directories
Code:
cd conf/
mkdir users/wonslung
mkdir users/jeff
mkdir users/snott
mkdir users/booger
now, if you do a ls you'll notice 3 files here:
Code:
wonslung@debian-pvm:/var/www/rutorrent/conf$ ls
access.ini config.php plugins.ini users
you need to copy these files into each user directory like so:
Code:
cp access.ini config.php plugins.ini users/wonslung
cp access.ini config.php plugins.ini users/jeff
cp access.ini config.php plugins.ini users/snott
cp access.ini config.php plugins.ini users/booger
now, it's important to know what these files do and what to change.
the most IMPORTANT file is config.php because it has the connection info. by default it looks like this:
Code:
<?php
// configuration parameters
@define('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0', true);
@define('HTTP_TIME_OUT', 30, true); // in seconds
@define('HTTP_USE_GZIP', true, true);
@define('RPC_TIME_OUT', 15, true); // in seconds
@define('LOG_RPC_CALLS', false, true);
@define('LOG_RPC_FAULTS', true, true);
$do_diagnostic = true;
$log_file = '/tmp/errors.log'; // path to log file (comment or make empty to disable logging)
$saveUploadedTorrents = true;
$scgi_port = 5000;
$scgi_host = "127.0.0.1";
$XMLRPCMountPoint = "/RPC2";
$pathToPHP = ''; // Something like /bin/php. If empty, will be founded in PATH.
$pathToCurl = ''; // 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";
?>
The parts you really need to pay attention to are these lines:
Code:
$scgi_port = 5000;
$scgi_host = "127.0.0.1";
$XMLRPCMountPoint = "/RPC2";
you need to edit the port and scgi mount for your user to match what you've previously set.
when you are setting a multiple user setup the files in the default conf/ dir can be left as default, it's only the files in the conf/users/USERNAME file which you copied which need to be editted.
Also, another thing which i'd like to note. A lot of people like to change the directory settings in this file. Don't unless you know what you are doing. These directories ARE NOT the same as your torrent directory or you download directory. They MUST be relative paths and they are only for internal rtorrent use.
anyways, if you did everything right, when you go to your page you should be ask to put in a username and password
depending on what you pick, you'll get a different user.
The other files which you copied are mainly to allow or disallow config options. If you wish to limit your users you can edit both access.ini and plugin.ini accordingly for each user.
good luck
This will explain the basic concepts behind rutorrent multi-user support.
It's important to note that this multiple user support STILL requires multiple rtorrent clients (one for each user) running on multiple scgi mounts. The only thing this new feature does is somewhat simplify setting up multiple users and allow you to run with a single domain.
It's also important to note that some form of authentication in your webserver is an integral part of this new multiple user setup and without authentication, this mod doesn't work. If you want multiple users without authentication then you need to user mutliple rutorrent directories as per the old method.
First, you need to create mutliple unix users. Each unix is different in this respect, and most have multiple methods of doing this, so seek out your specific documentation for how to do this.
once you have multiple users, you'll want to create a .rtorrent.rc for each user. you can use relative paths for stuff making the download directory and session directory easier to set up, but how you do this is really up to you. What is important here is that the FOLLOWING things are different in your .rtorrent.rc:
port for rtorrent (or range if you use a range, though you can get away with a single port in rtorrent for each user by doing something like this:
Code:
port_range = 51000-51000
scgi port
Code:
scgi_port = 127.0.0.1:5001
and if you use a dht port, this should be different as well. If you wish to make other settings you can, like i said, this is mainly up to you and i'd refer to rtorrent documentation for this.
once you have this, you'll want to set up multiple scgi mounts in your webserver...if you've installed rutorrent before then you know how to do this, it is different for ALL webservers, but what is important is that you have one mount for EACH user. The port should match whatever you set in the users .rtorrent.rc
you should also be sure to set up basic authentication. Your best bet is to put this on the web root which rutorrent will be run from. Set one username/password for each user. Again, this will varry from server to server so seek out your documentation.
now, you just need to get the rutorrent files. currently, the only method of downloading the rutorrent files for 3.0 is via svn so install subversion on your system and use the following command:
Code:
svn checkout http://rutorrent.googlecode.com/svn/branches/3.0/
this will download all the rutorrent 3.0 files AND all the rutorrent 3.0 plugins. Then, what you need to do is remove the rpc plugin, remove darkpal if you think it's as ugly as i do, and any other plugin you don't wish to use. This would look like this provided you JUST finished downloading via svn:
Code:
cd 3.0
rm -r plugins/rpc plugins/darkpal rutorrent/plugins
mv plugins/ rutorrent/
now you need to change some permissions or ownership. lets assume your webserver is owned by user www, you could do the following:
Code:
cd rutorrent/
chown -R www:www share/
if you don't know your webuser's name, just use chmod 777 instead like this:
Code:
cd rutorrent/
chmod -r 777 share/
now, you need to add a directory for each user in the conf/users/ directory and copy the config files for each into that dir, then edit each accordingly.
We're going to pretend you set up 4 users
user1 = wonslung and his SCGI mount is on /RPC1 and port 5001 (he's the coolest user you have)
user2 = jeff and his SCGI mount is on /RPC2 and port 5002
user3 = snott and his SCGI mount is on /RPC3 and port 5003
user4 = booger and his SCGI mount is on /RPC3 and port 5004
get the idea?
ok
so you're probabaly still in the rutorrent directory, this is good....we want to change to the conf dir and make some user directories
Code:
cd conf/
mkdir users/wonslung
mkdir users/jeff
mkdir users/snott
mkdir users/booger
now, if you do a ls you'll notice 3 files here:
Code:
wonslung@debian-pvm:/var/www/rutorrent/conf$ ls
access.ini config.php plugins.ini users
you need to copy these files into each user directory like so:
Code:
cp access.ini config.php plugins.ini users/wonslung
cp access.ini config.php plugins.ini users/jeff
cp access.ini config.php plugins.ini users/snott
cp access.ini config.php plugins.ini users/booger
now, it's important to know what these files do and what to change.
the most IMPORTANT file is config.php because it has the connection info. by default it looks like this:
Code:
<?php
// configuration parameters
@define('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0', true);
@define('HTTP_TIME_OUT', 30, true); // in seconds
@define('HTTP_USE_GZIP', true, true);
@define('RPC_TIME_OUT', 15, true); // in seconds
@define('LOG_RPC_CALLS', false, true);
@define('LOG_RPC_FAULTS', true, true);
$do_diagnostic = true;
$log_file = '/tmp/errors.log'; // path to log file (comment or make empty to disable logging)
$saveUploadedTorrents = true;
$scgi_port = 5000;
$scgi_host = "127.0.0.1";
$XMLRPCMountPoint = "/RPC2";
$pathToPHP = ''; // Something like /bin/php. If empty, will be founded in PATH.
$pathToCurl = ''; // 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";
?>
The parts you really need to pay attention to are these lines:
Code:
$scgi_port = 5000;
$scgi_host = "127.0.0.1";
$XMLRPCMountPoint = "/RPC2";
you need to edit the port and scgi mount for your user to match what you've previously set.
when you are setting a multiple user setup the files in the default conf/ dir can be left as default, it's only the files in the conf/users/USERNAME file which you copied which need to be editted.
Also, another thing which i'd like to note. A lot of people like to change the directory settings in this file. Don't unless you know what you are doing. These directories ARE NOT the same as your torrent directory or you download directory. They MUST be relative paths and they are only for internal rtorrent use.
anyways, if you did everything right, when you go to your page you should be ask to put in a username and password
depending on what you pick, you'll get a different user.
The other files which you copied are mainly to allow or disallow config options. If you wish to limit your users you can edit both access.ini and plugin.ini accordingly for each user.
good luck
Last edited: