Saturday, September 13, 2008

Installing Torrentflux

Torrentflux. Whats is torrentflux ?.

Torrent flux is a php based torrent client which runs on a web server/ website.

Conventionally, people will install torrent clients such as azureus, utorrent which runs on their computer to do the torrent job and they are not php based.

Torrentflux will download the files to the web server /website first, and users are need to redownload them into their computer after the download is complete. Whereas computer based torrent client download the files directly into the computer and users are not needed to download them again.

People use torrentflux because:

1. Their ISP (internet company that they subscribe to) block torrent.

2. They do not have time to turn on their computer 24 hours per day.

3. To achieve greater speed!

The Torrent concept

Direct download, computer to computer such as downloading file from download.com, cause a heavy load on the web server. Imagine thousands of computers download thousands of files at to the same time, from the same web server.

Moreover, if the web server broke down, thousands will get affected!

So the concept behind torrent is to cut the files to thousands of pieces and begin to distribute them. After that, participants (or people who are downloading the files) will download (take) and upload (give) the pieces among themselves. Instead of relying on one computer, there are now relying and sharing on many people. More like of team work.

After all the pieces have been downloaded, ta-da! Your computer will assemble the files and now you have the complete files!

Major components

Anatomically, there are 3 major parts.

1. Torrent client – such as Torrentflux, azureus etc. Torrent client is the heart of torrent. It manages and downloads the file. It uses torrent meta files to get information regarding who have the pieces.

2. Meta file – associated with *.torrent type file, this piece of file are the navigator to the Torrent client to tell it where to get information regarding the pieces.

3. Tracker - A web server /website which manage who have the pieces. This is actually none of your concern and you have no power to it. This is the brain that manages and gathers information around the world, regarding who have the pieces. A torrent client uses meta files file to connect to trackers.

Supposed that one of these components unavailable, you cannot get the download process running.

Essential terms

Seeder – people who have complete pieces of the file(s)

Leecher – people who do not have all the pieces and are downloading it.

Ratio – The amount of availability of the file. If it is 1.00 and above, at least 1 copy of all the pieces are available and it is possible to get the complete files. 1.00 ratio means 1 complete sets of pieces. 4.00 means 4 complete sets of pieces. The more the merrier.

NEVER DOWNLOAD FILE WHICH HAS 0 SEED OR RATIO BELOW 1.00 !

What do I need to use torrentflux?

Here's what you need:

1. Linux based webserver

2. Apache

3. MySQL

4. PHP Version 4.3.x or higher

5. Perl 5.6

7. Apache

8. MySQL

9. PHP Version 4.3.x or higher

10. Perl 5.6

Frankly speaking there are more but not so significant I guess. As long as you have these stuff, your percentage to succeed is high.

One more thing, ask whether you web site company allows you to use the torrent. It is no use if you met all the requirements but your company blocks it

On your host, find out a working link for downloading Torrentflux at http://prdownloads.sourceforge.net/torrentflux/torrentflux_2.1.tar.gz?download
Choose a location near you and choose download. Cancel the download and write down the link shown below in blue (haven't found a way to paste text into my vmware-window yet)

back in your machine type:

wget

e.g.

wget http://belnet.dl.sourceforge.net/sourceforge/torrentflux/torrentflux_2.1.tar.gz

If you need to use a proxy server begin with setting up your proxy server in you current environment:

http_proxy=http://:;export http_proxy

or if you want this to be permanent: edit the /etc/wgetrc and fill the proxy settings there.
To edit the /etc/wgetrc file you need to know how to use vi, this is beyond the scope of this how-to.

Result:


All right, we downloaded Torrentflux, now on to installing it. Set mysql root password:

mysqladmin -u root -p password

when asked for a password: just press
it's the current mysql root password which isn't assigned yet.

Unpack Torrentflux:

tar zxvf torrentflux_2.1.tar.gz
cd torrentflux_2.1
mysqladmin -u root -p create torrentflux

cd sql
mysql -u root -p torrentflux <>

cd ../html


Set up the config.php:

vi config.php

Now edit the settings as below:

Consult a vi manual to find out how vi works.
After saving your updated config.php file copy the files to your web server root directory:

sudo mkdir /var/www/tf
sudo cp -rf * /var/www/tf

Create a folder to save the downloaded torrents

cd /home
sudo mkdir shared
sudo chmod 777 shared
cd shared
mkdir torrent
chmod 777 torrent

If everything went OK it's time to try if it's working and to set up the last bits in Torrentflux. To find out what the ip address is of your new server:

ip address

Look for the eth0 network card:
in my case the ip address is: 172.16.50.83

On your host: open your webbrowser and go to:

http://webserver_name/tf

Tadaaaa! :)

Login with: root and mysql password:

As a final step: change the path to: /home/shared/torrent and press 'Update settings'

Next Chapter "how to use torrentflux".


No comments: