Wtorrent

Note: Large amounts of this article are taken from the rTorrent article so if something fails give that a try

Introduction
wTorrent is a web interface to the popular rTorrent. It allows users to take advantage of the fast and small rTorrent while still having a GUI.

PHP and lightTPD
First of all wTorrent uses php and pdo calls so we need to emerge php.

After this we need to install lightTPD.

rTorrent
Of course we need to install rTorrent if we want to be able to interface with it through wTorrent. Note: rTorrent now has a USE flag option of daemon so we will want to enable this as it has a better init script.

wTorrent
To install wTorrent we can either use the SVN snapshot from the webpage OR checkout the SVN tree

SVN snapshot
Now we also need to go and download and install wTorrent. All we need to do it go to the wTorrent site and download the package.

wTorrent Download

Now the wTorrent archive needs to be extracted and the wTorrent folder under trunk needs to be places in our webroot. Normally

SVN Checkout
The SVN of the code is seen as the current work so you can grab this if you like rather then the archive off the page. For this you will need subversion if you do not have it.

then we can cd into our webroot

Now we CheckOut the svn tree for wtorrent

This will make the directory wtorrent and download the program there.

LightTPD
We need to turn on the module responsible for scgi support, along with two others. Surprisingly the module is called mod_scgi, and we add it to the server configuration. If mod_scgi isn't already there, add it to the list right above mod_accesslog.

If you are already making use of lightTPD as a web server, you might want to back up your current.

Then, at the end of that file, we add lines responsible for rtorrent interactions:


 * "host" is set to the localhost, which is where rTorrent will be running.
 * "port" is arbitrarily set, but it must be the same port used later for rTorrent.

Now, assuming everything is configured right, lightTPD should start up fine.

rTorrent
Now rTorrent needs to be configured so that it will start and run on its own at boot. The daemon USE Flag installs an init script for us but some changes can be made. First off in /etc/conf.d/rtorrentd it defaults to use the logged on user to start rTorrent. In the boot process this be root so this is a bad idea to leave as it is. It is a good idea to change this to a user account devoted to rtorrent. So a user called rtorrent or wtorrent or similar is a good idea.

Now that we have a user account and a script to start it we need to configure rTorrent. A basic config can be found at /usr/share/doc/rtorrent/rtorren-0.8.4/rtorrent.rc.bz2 Once modified to suit it needs to be saved in /home/rtorrent/.rtorrent.rc

The 2 most important lines from that config are most likely

and this line that needs to be added.

As it is the line that tells rTorrent to reload the torrents already started and so it can communicate with the wTorrent front end.

Now we need to add a folder, change some permissions, and rename a file

Now everything should be working and we can start up rTorrent via the script

Now we need to direct our web browser at the wTorrent install page. http://127.0.0.1/wtorrent/install.php The port number it needs is the port that lighttpd is running on not the port number set in .rtorrent.rc And that is it your should now have successfully installed wTorrent and rTorrent.