How to install and configure rutorrent client | linux debian distribution
First connect to server through ssh.
First you need to retrieve new lists of packages (first must be sure your repository is up to date or not and you must be sudoer)
Code:
# sudo apt-get update
then you need to perform an upgrade
Code:
# sudo apt-get upgrade
and then some need to install requirements :
Code:
#sudo apt-get install subversion build-essential automake libtool libcppunit-dev libcurl4-dev libsigc++-2.0-dev unzip unrar rar zip curl libncurses5-dev
subversion : for SVN command
build-essential : you need this to build debian packages (for example when you want to use dpkg command to install or ... debian pakage)
automake : for automatically generating Makefile.in files (you must use 'make' and 'make install' command when you want to compile and install rtorrent, libtorrent
libcppunit-dev libcurl4-dev libsigc++-2.0-dev libncurses5-dev : libraries required to compile and install rtorrent, libtorrent
unzip unrar rar zip : to compress and decompress files(for example you can use filemanager to rar or unrar files or you can do this with typing unrar 'filename' in terminal)
curl or cURL : transferring data using various protocols like FTP, SFTP, HTTP, ...
Code:
# sudo apt-get install apache2 php5 php5-cli php5-curl
apache2 : web server
php5 : you need that for rutorrent.(php is a server-side, HTML-embedded scripting language)
php5-cli : command-line interpreter for the php5 scripting language. to run CLI shell scripts, commands. like mkdir to make directory using filemanager script.
Code:
# sudo apt-get install libapache2-mod-scgi
Apache module implementing the SCGI protocol.
SCGI : Simple Common Gateway Interface - Wikipedia, the free encyclopedia
you must download stable version of xmlrpc
Code:
# sudo svn checkout http://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable
XMLRPC : to call procedures remotely using XML language.
Remote procedure call - Wikipedia, the free encyclopedia
Change directory
Code:
# sudo ./configure --enable-cplusplus=no
--enable-cplusplus=no : means don't enable cplusplus fearture
and then compiling and installation:
Code:
# sudo make
# sudo make install
and then you must compile and install the libtorrent. LibTorrent is a BitTorrent library written in C++. required to compiling rtorrent.
first you must download it :
Code:
# sudo wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.13.3.tar.gz
and then decompress it :
Code:
# sudo tar -xvf libtorrent-0.13.3.tar.gz
x: extract files to libtorrent-0.13.3, v: to list processed files, f: use libtorrent-0.13.3.tar.gz archive file
change directory :
Code:
# cd libtorrent-0.13.3
Code:
# sudo ./autogen.sh
autogen.sh : A shell script that provides automatic build system preparation.
and then configuring and compiling and installing :
Code:
# sudo ./configure
# sudo make
# sudo make install
and then configuring and compiling and installing rtorrent :
ldconfig : Sometimes when you install a program from source it can complain that a certain library is missing
and then configuring and compiling and installing ruTorrent :
chown : change owner of files and folders
-R : recursively do that for all files and subdirectories
www-data:www-data : Owner:Group
then you must make some directories for watch, downloaded data for each user
Code:
# sudo mkdir /home/USERNAME/rutorrent
# sudo mkdir /home/USERNAME/rutorrent/session
# sudo mkdir /home/USERNAME/rutorrent/watch
# sudo mkdir /home/USERNAME/rutorrent/data
replace USERNAME with username of owner.
and then paste this lines there :
Code:
directory = /home/USERNAME/rtorrent/download
session = /home/USERNAME/rtorrent/session
schedule = watch_directory,1,1,"load_start=/home/USERNAME/watch/*.torrent"
bind = 127.0.0.1
port_range = 6890-6999
scgi_port = localhost:PORT
PORT : Specified port for SCGI(must be same as port that specified in /var/rutorrent/conf/config.php for SCGI. (use : nano /var/rutorrent/conf/config.php to edit))
Press Ctrl+O and then Enter and finally Ctrl+X
Code:
# sudo apt-get install screen
Screen : GNU Screen - GNU Project - Free Software Foundation
and finally start rtorrent :
Code:
# screen -fa -d -m rtorrent
how to secure rutorrent :
Code:
# sudo a2enmod ssl
# sudo a2enmod auth_digest
# sudo a2enmod scgi
# sudo openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem
# sudo chmod 600 /etc/apache2/apache.pem
# sudo htdigest -c /etc/apache2/passwords seedbox PASSWORD
PASSWORD : user specified password.
rtorrent as a service :
Code:
# nano etc/init.d/rtorrent
paste following text :
Code:
depend() {
use net
}
start() {
ebegin "Starting rtorrent"
start-stop-daemon --start --chuid $USER \
--env TERM="xterm" \
--env HOME="/home/$USER" \
--exec $DTACH -- -n $SOCKET $RTORRENT
eend $?
}
stop() {
ebegin "Stopping rtorrent"
start-stop-daemon --stop --signal 2 --name rtorrent
eend $?
}
Ctrl+O then Enter finally Ctrl+X