Install xmlrpc-c, libtorrent, rtorrent and rutorrent from svn

Set and create the dir we will use for svn checkouts

svnpath="/svn/"
sudo mkdir $svnpath
sudo chown -R $USER:$USER $svnpath

Install everything you will need and remove xmlrpc or else rtorrent will complain because it uses the one from the repos

sudo apt-get remove libxmlrpc-c*
sudo apt-get install subversion gcc apache2 curl libcurl4-openssl-dev automake autoconf texinfo libapache2-mod-scgi build-essential libtool openssl libsigc++-2.0-dev libncurses-dev libcppunit-dev php5

Configure, make and make install xmlrpc-c

cd "$svnpath"
svn co http://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/advanced xmlrpc-c
cd xmlrpc-c
./configure
make
sudo make install

Configure, make and make install libtorrent and rtorrent

cd "$svnpath"
svn co svn://rakshasa.no/libtorrent/trunk rtorrent
cd rtorrent
cd libtorrent
./autogen.sh
./configure
make
sudo make install
sudo ldconfig
cd ../rtorrent
./autogen.sh
./configure --with-xmlrpc-c
make
sudo make install

Install libxmlrpc-c3-dev

sudo apt-get install libxmlrpc-c3-dev

Get the latest rutorrent

cd $svnpath

svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent/ rutorrent

To enabel scgi in apache run

sudo a2enmod scgi

To add a scgi mount in apache edit /etc/apache2/httpd.conf

sudo nano /etc/apache2/httpd.conf

and add

SCGIMount /RPC2 127.0.0.1:5000

Then restart apache

sudo service apache2 restart

We also have to add the mount to your rtorrent conf file

In your ~/.rtorrent.rc file

nano ~/.rtorrent.rc

add

scgi_port = localhost:5000

Create a symbolic link to rutorrent in /var/www/

sudo ln -s $svnpath/rutorrent /var/www/

Change ownership of rutorrent/share/torrents/ and rutorrent/share/settings to the one who runs the apache2 server

Set www-data as group of rutorrent/share/torrents/ and rutorrent/share/settings/

sudo chown -R $USER:www-data $svnpath/rutorrent/share/torrents/ $svnpath/rutorrent/share/settings/

And allow the group (www-data) to edit those dirs

chmod g+w $svnpath/rutorrent/share/torrents/ $svnpath/rutorrent/share/settings/

Test

You can test rtorrent and rutorrent by running

cd /tmp/
rtorrent http://releases.ubuntu.com/10.04.1/ubuntu-10.04.1-server-i386.iso.torrent

To download lucid server iso to /tmp

Then check so rutorrent is working by going to

http://server/rutorrent/

ex. http://192.168.0.2/rutorrent/

It should not be any errors.

And that is all.

When you want to upgrade xmlrpc-c, libtorrent, rtorrent or rutorrent simply run everything again. (see below for script)

For lazy people

bash script for everything

#Set and create the dir for all svn stuff...
svnpath="/svn/"
sudo mkdir $svnpath
sudo chown -R $USER:$USER $svnpath
#Install everything you need
sudo apt-get remove libxmlrpc-c*
sudo apt-get install subversion gcc apache2 curl libcurl4-openssl-dev automake autoconf texinfo libapache2-mod-scgi build-essential libtool openssl libsigc++-2.0-dev libncurses-dev libcppunit-dev php5
#configure, make and make install xmlrpc-c
cd "$svnpath"
svn co http://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/advanced xmlrpc-c
cd xmlrpc-c
./configure
make
sudo make install
#configure, make and make install libtorrent and rtorrent
cd "$svnpath"
svn co svn://rakshasa.no/libtorrent/trunk rtorrent
cd rtorrent
cd libtorrent
./autogen.sh
./configure
make
sudo make install
sudo ldconfig
cd ../rtorrent
./autogen.sh
./configure --with-xmlrpc-c
make
sudo make install
#install libxmlrpc-c3-dev
sudo apt-get install libxmlrpc-c3-dev
#get the latest rutorrent
cd $svnpath
svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent/ rutorrent
#To enabel scgi in apache run
sudo a2enmod scgi
#run
sudo nano /etc/apache2/httpd.conf
#and add
#SCGIMount /RPC2 127.0.0.1:5000
#then restart apache
sudo service apache2 restart
#then in your .rtorrent.rc file
nano ~/.rtorrent.rc
#put
#scgi_port = localhost:5000
#in the file
#create a symbolic link to rutorrent in /var/www/
sudo ln -s $svnpath/rutorrent /var/www/
#set www-data as group of rutorrent/share/torrents/ and rutorrent/share/settings/
sudo chown -R $USER:www-data $svnpath/rutorrent/share/torrents/ $svnpath/rutorrent/share/settings/
# and allow the group (www-data) to edit those dirs
chmod g+w $svnpath/rutorrent/share/torrents/ $svnpath/rutorrent/share/settings/
Posted in how-to, Ubuntu | 3 Comments