TorrentFlux

From TMB Wiki

Jump to: navigation, search

Contents

Torrentflux

Torrentflux is PHP based Bit Torrent Client which runs on a webserver. It uses the original python based Bit Torrent client along with a web interface which allows you to manage all of your torrents. It is particularly handy for those of us who run *nix servers at home or elsewhere, and what to utilise the servers uninterupted uptime for seeding and leeching. It also doesn't require and desktop environment or X server, cos you don't want that on your slick server now :-)

The original Torrentflux is available from here.

There is also a fork of the original version of Torrentflux that is named torrentflux-b4rt and is available from here.

Features

TorrentFlux has some neat features like the integration of RSS feeds, managment of torrent directory (deleting files/folders), downloading finnished torrents "tarred" up, graphical diskspace usage, multiple users, the list goes on...

Torrenflux-b4rt has more options than the original version of torrentflux including:

  • Supports multiple internet transfer protocols
  • Unified transfer control
  • Transfer statistics and logging
  • Uploading and injection of metafiles (.torrent, .wget, .nzb files)
  • fluxcli.php - a complete command-line version of torrentflux-b4rt
  • Fluxd - background perl daemon to perform scheduled tasks
  • Integrated Filemanager AJAX updates for maximum info with minimal bandwidth
  • AJAX updates for maximum info with minimal bandwidth
  • Templating engine
  • Supports bittornado and transmission.

What do you need

  • A webserver running Apache w/ PHP module
  • MySQL
  • Python Support
  • Torrentflux or Torrenflux-b4rt

Getting Started

I'm going to assume that you are savvy enough to get Apache, MySQL and PHP (the AMP of LAMP) up and running. There have books been written about this software combo, but its not really that tough to get a basic setup going. I will also assume that you have a reasonably recent version of Python installed.

Once you have grabbed yourself a copy of TorrentFlux unpack it in you webroot and let the configuration begin.

Getting Started - Fedora/CentOS

To get Torrentflux to run under Fedora is pretty simple:

1. You need to have a webserver

# sudo yum -y install httpd

You will need to setup apache - take a look here

2. You need to have a database

# sudo yum -y install mysql mysql-server php-mysql

3. Get a copy of torrentflux-b4rt

# wget http://download.berlios.de/tf-b4rt/torrentflux-b4rt_1.0-alpha7.tar.bz2

4. Extract the archive, I always extract the archive to /var/www/

# tar -xjvf torrentflux-b4rt_1.0-alpha7.tar.bz2

After the archive has been extracted there is a "html" directory - i move the contents of that directory to /var/www/html, that is a personal preference as i only run torrentflux-b4rt on my webserver. YMMV

5. Start the required services

# sudo /sbin/service mysqld restart
# sudo /sbin/service httpd restart

6. Point the browser at the setup file - there is a setup.php file in the /var/www/html directory

Configuration

TorrentFlux settings are all located in the config.php file, nice and simple. Open up this with your favourite text editor (mine is the no-nonsense nano). The first lines are database configuration.

$cfg["db_type"] = "mysql";       // mysql, postgres7 view adodb/drivers
$cfg["db_host"] = "localhost";   // DB host computer name or IP
$cfg["db_name"] = "torrentflux"; // Name of the Database
$cfg["db_user"] = "user";        // username for your MySQL database
$cfg["db_pass"] = "password";    // password for database

Next is configuring the path where TorrentFlux will do its business.

$cfg["path"] = "/path/to/torrent/storage";

This directory must be writeable by the user under which apache runs, so this usually requires a chmod 777. Dont make this path in your webroot for this very reason.

The next two are the paths to the python Bit Torrent client that Torrentflux uses. TorrentFlux uses a special version of either the Bit Torrent or Bit Tornado client called 'btphp(tornado/torrent).py' and these are packaged along with TorrentFlux. Provide the full path to these files, be it in you webroot or somewhere else in the system. btshowmetainfo.php is also required and gives a run down of what the torrent you are downloading is all about.

$cfg["btphpbin"] = "/var/www/localhost/TF_BitTornado/btphptornado.py"; // My paths, replace with your own
$cfg["btshowmetainfo"] = "/var/www/localhost/TF_BitTornado/btshowmetainfo.py";

The rest of the setting are pretty self-explanatory, the whole thing is actually. The max upload and download rates are per torrent. Unfortunately there is no way to get TorrentFlux to control the total speed of torrent activity. TorrentFlux works by spawning a new process for every torrent, using the python client. It then keeps a track of its activity and reports it through the webinterface. There is no way to modify the torrents upload/download speed on the fly.

B4RT Related Tips

fluxcli

This is a useful command that I use when I need bandwidth and i do not have time to stop all my torrents from the browser:

# php /var/www/html/fluxcli.php stop

And you will need to restart the torrents:

# php /var/www/html/fluxcli.php resume-all or
# php /var/www/html/fluxcli.php start-all

This is a useful command if you need to reset the torrents - usually when i have to reboot the torrent server ie every 6 months:

# php /var/www/html/fluxcli.php repair

Conclusion

TorrentFlux is a pretty sweet little piece of software. It doesn't have all the bells and whistles of other Bit Torrent clients but its intended for running in the background, on a machine that is on 24/7 anyway. There are some cool mods for it available through the TorrentFlux forum, they usually involve hacking php scripts and splicing new code into them. There was probably little need for a HOW-TO but I was bored today.

--ckupris 21:12, 26 March 2006 (BST)

--fatboynz 17:50, 09 April 2007 (NZST)

Personal tools