Here is a simple guide on how to install rtorrent/rutorrent on Debian 7 Wheezy , It may also work on Ubuntu and other Debian based Linux distros.
Install prerequisite packages :
1 | apt-get install gcc pkg-config libssl-dev g++ make libncurses5-dev libsigc++-2.0-dev libcurl4-openssl-dev subversion screen nano |
Install XMLRPC-C , it is required for rutorrent communication with rtorrent :
1 2 3 4 5 | svn co http: //svn .code.sf.net /p/xmlrpc-c/code/advanced xmlrpc-c cd xmlrpc-c . /configure make make install |
Install LibTorrent required by rtorrent :
1 2 3 4 5 6 | wget http: //libtorrent .rakshasa.no /downloads/libtorrent-0 .13.3. tar .gz tar zxvf libtorrent-0.13.3. tar .gz cd libtorrent-0.13.3 . /configure make make install |
Install rtorrent client :
1 2 3 4 5 6 7 | wget http: //libtorrent .rakshasa.no /downloads/rtorrent-0 .9.3. tar .gz tar zxvf rtorrent-0.9.3. tar .gz cd rtorrent-0.9.3 . /configure --with-xmlrpc-c make make install ldconfig |
Now, we have to make a user for rtorrent and configure it :
1 2 3 4 5 | useradd user1 mkdir -p /home/user1/rtorrent mkdir -p /home/user1/rtorrent/ .session mkdir -p /home/user1/rtorrent/download chown -R user1:user1 /home/user1 |
Copy rtorrent sample config from rtorrent source directory to user1 home directory :
1 | cp rtorrent-0.9.3 /doc/rtorrent .rc /home/user1/ .rtorrent.rc |
Now you can customize the configuration :
1 | nano /home/user1/ .rtorrent.rc |
But what you need to customize are following options :
1 2 3 | directory = /home/user1/rtorrent/download session = /home/user1/rtorrent/ .session scgi_port = localhost:5000 |
It is time to run rtorrent, This command runs rtorrent as user1 :
1 | su - user1 -c 'screen -fa -d -m rtorrent' |
Now we can install Apache + php5 which is required by rutorrent :
1 | apt-get install libapache2-mod-php5 |
Enable auth_digest module which is required for rutorrent authentication :
1 | a2enmod auth_digest |
Install rutorrent+pluins :
1 2 3 4 5 6 7 | wget http: //dl .bintray.com /novik65/generic/rutorrent-3 .6. tar .gz tar zxvf rutorrent-3.6. tar .gz mv rutorrent /var/www wget http: //dl .bintray.com /novik65/generic/plugins-3 .6. tar .gz tar zxvf plugins-3.6. tar .gz mv plugins /var/www/rutorrent/ |
Tip : The only plugin which you need is httprpc. you can disable or delete all the rest.
Configure user1 on rutorrent :
1 2 3 | mkdir -p /var/www/rutorrent/conf/users/user1 cp /var/www/rutorrent/conf/config .php /var/www/rutorrent/conf/users/user1 nano /var/www/rutorrent/conf/users/user1/config .php |
Make sure $scgi_port in config.php matches scgi_port in rtorrent config file :
1 | $scgi_port = 5000; |
For rutorrent web authentication create .htaccess file in rutorrent directory :
1 | nano /var/www/rutorrent/ .htaccess |
Copy and paste the following inside .htaccess :
1 2 3 4 5 | AuthName "Restricted Area" AuthType Basic AuthUserFile /etc/.htpasswd AuthGroupFile /dev/null require valid-user |
Create password file for Apache :
1 | htdigest -c /etc/ .htpasswd "Restricted Area" user1 |
Now we need to configure Apache to allow .htaccess override :
1 | nano /etc/apache2/sites-enabled/000-default |
Change :
1 2 3 4 5 6 | <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> |
To :
1 2 3 4 5 6 | <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> |
And finally restart apache :
1 | /etc/init .d /apache2 restart |
Now you should be able to access your rtorrent/rutorrent on this address : http://IP_SERVER/rutorrent