Torrentflux with Transmissioncli

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 22:54, 30 August 2007 by Bauldrick (Talk | contribs) (Installation)

Jump to: navigation, search



Torrentflux is a multi-user GUI for BitTornado. It is scripted in PHP, with a MySQL database and runs on a web server. The most recent beta release also includes support for ADOdb, allowing for use of other database backends. Numerous "hacks" have been written to add additional functionality.

Transmission is a free, lightweight BitTorrent client. It features a simple, intuitive interface (we won't be using here) on top on an efficient, cross-platform back-end.


You will need to install either:

  1. LAMP Steps 1-5
  2. LLMP
  3. LLSP


May not be needed - Get python and perl

apt-get install python perl

May not be needed - Get cksfv and unrar (you will need non-free in /etc/apt/sources.list for unrar)

apt-get install cksfv unrar libevent-dev

Goto webservers root directory (/var/www)

cd /var/www

Download torrentflux-b4rt into said directory


Note: 08-2007 - The newest Version b4rt beta1 seems to address some problems appearing in older versions. If you have problems with server overload (permanent usr > 3.0), try to use the newest:


Untar the downloaded file and move into it

tar -jxvf torrentflux_2.1-b4rt-98.tar.bz2 && cd torrentflux_2.1-b4rt-98

Configure and make transmissioncli

cd clients/transmission 
tar -jxvf Transmission-0.7-svn1302_tfCLI-svn1995.tar.bz2
cd Transmission-0.7-svn1302_tfCLI-svn1995

./configure --prefix=/usr/local --disable-gtk --sysconfdir=/etc
make install

See if it's in the right place

locate transmissioncli 

Should be in /mnt/hda/usr/bin/transmissioncli (shouldn't it be in /usr/local/bin instead since we specified --prefix=/usr/local?).

Populate the database

For Mysql Database

cd ../../../sql/mysql
mysqladmin create torrentflux

(if you set a passwd for mysql root then use this and enter passwd at prompt)

mysqladmin -p create torrentflux 

and then

mysql torrentflux < mysql_torrentflux_tf-b4rt-98.sql

(if you set a passwd for mysql root then use this and enter passwd at prompt)

mysql -p torrentflux < mysql_torrentflux_tf-b4rt-98.sql
cd ../../html
mv config.db.php.dist config.db.php

(if you set a passwd for mysql root you need to edit)

pico config.db.php

add passwd

$cfg["db_pass"] = "<add passwd>";             // Password for Database

For SQLite Database

Create the initial database. Note that we create the database file in the db/ subdirectory and make both owned by the web server's user:group (after executing the following commands, check that permissions for db/ and db/torrentflux are 0755 and 0644 respectively). A directory writable by the web server is necessary because SQLite needs this for some reason when executing INSERT statements (otherwise you'll get the unable to open database file error).

cd ../../../sql/sqlite  
mkdir db
sqlite db/torrentflux < sqlite_torrentflux_tf-b4rt-98.sql
chown -R www-data:www-data db

Setup the database in Torrentflux.

cd ../../html
cp config.db.php.dist config.db.php
pico config.db.php

Alter the database settings so that they will look like:

$cfg["db_type"] = "sqlite";        // Database-Type : mysql/sqlite/postgres
$cfg["db_host"] = dirname(__FILE__) . "/../sql/sqlite/db/torrentflux";    // Database host computer name or IP
$cfg["db_name"] = "";             // Name of the Database
$cfg["db_user"] = "";             // Username for Database
$cfg["db_pass"] = "";             // Password for Database
$cfg["db_pcon"] = false;          // Persistent Connection enabled : true/false


Make it readable for apache user:group

chown -R www-data:www-data /var/www/torrentflux_2.1-b4rt-98/html

Now you will need to create a file in apache to see torrentflux

pico /etc/apache/conf.d/torrentflux.conf 

and add this to that file

 # Torrentflux Virtual Host Configuration file
Listen 8090
<VirtualHost _default_:8090>
       DocumentRoot "/var/www/torrentflux_2.1-b4rt-98/html"
       <Directory "/var/www/torrentflux_2.1-b4rt-98/html">
               Options Indexes FollowSymLinks MultiViews
               AllowOverride None
               Order allow,deny
               Allow from all
       <IfModule mod_dir.c>
               DirectoryIndex index.html index.php

Restart apache

/etc/init.d/apache restart


Make it readable for apache user:group

chown -R www-data:www-data /var/www/torrentflux_2.1-b4rt-98/html

Restart Lighttpd

/etc/init.d/lighttpd restart

Run it


Go to your Torrentflux on your Linkstation



Go to your Torrentflux on your Linkstation


Configure it

You should see this

Torrentflux Login.JPG

Enter user name and passwd - WARNING!! - That is for the superuser, so don't forget it

Check all the admin settings pages and configure your installation - i.e select transmissioncli as default client and point it in the right direction. You will need to correct everything highlighted red (apart from bittornado unless you are going to use it).

Problems and Issues

Linkstation Pro : ARM Processor Running out of memory after ca. 24 hours of running. Needed to add more swap space. Search the wiki for "Adding more swap to Linkstation" Generally, the 128 MB RAM + 256 MB swap are NOT enough for running the lighttpd + SQLite + python (the queue manager) + 2 torrents, each with 2 ports open

Recommended: If you add swap, do it right, 512 MB minimum.

Running more than 6 torrents at a time can rapidly increase server load. Typical example: 8 torrents downloading simultaneously, 128 MB RAM, 1 GB swap space, load avg: 3.2 3.6 3.6 which means, that your processor is overloaded by ca. 320% (current value) 360% (5 minutes average) and 360% (last 15 minutes average). Good values are between 0 and 2 for your Linkstation and your nerves.

Recommended settings

  • Queue manager: max. 6 torrents simultaneously global for the whole server
  • Max. download rate per torrent: I use (My bandwidth = 900 kb/s)/(Number of simult. torrents = 6) = 150 kb/s
  • Max. upload rate per torrent: I use (My upload bandwidth = 100 kb) / (Number of simult. torrents = 6) >> 10 kb/s
  • Max. connections per torrent: 1 or 2, opening more ports per torrent (more than 12 in total) may slow down your Linkstation

Bauldrick 11:38, 4 December 2006 (EST) Minor changes by mosi 30.08.2007