Page 1 of 4 123 ... LastLast
Results 1 to 10 of 435

Thread: How-to: Installing Torrent-Flux

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Beans
    923
    Distro
    Kubuntu 8.04 Hardy Heron

    How-to: Installing Torrent-Flux

    Important Note:
    This how-to was written for Ubuntu 6.06 (Dapper Drake), for manually installing torrentflux.

    However, torrentflux has since been added to the repositories. Thus, installation should now be much simpler. You can just go to the Synaptic package manager (Applications > Add/Remove) and install it. (Use Adept on Kubuntu.) On the commandline, you can go:

    Code:
    sudo aptitude install torrentflux
    That replaces steps 3 and 4a from the guide. The rest of the guide details other aspects of getting torrentflux installed and working. You can also use the entire guide (including steps 3 and 4a) if you want to do a manual install for some reason.







    I've had several friends ask about how to get torrentflux working, so I'm posting this how-to to in case anyone else finds it useful.

    Introduction
    Torrentflux is a neat open-source bit-torrent application. The interesting thing about it is that it runs entirely as a web-application. This means that you can access it remotely, from anywhere, using a web-browser. You can initiate, monitor, and manage your bit-torrent downloads while away from your computer.

    The only 'catch' is that you need to be running a full webserver (including PHP and MySQL) for this to work. Luckily it's rather simple to get this working in Linux. If you're running Ubuntu, you should have no problem getting this to work.

    It may seem like 'overkill' to install a whole LAMP environment just for torrentflux, however you may soon discover that there are many neat things you can do with a functional LAMP stack. Torrent-flux is only one example.


    Step 1: Get a functional LAMP stack.

    To get a 'LAMP' stack running (Linux Apache Mysql Php), you just install the packages "apache2", "php5" and "mysql-server". You can do this using Synaptic (Ubuntu) or Adept (Kubuntu), or on the command line:
    Code:
    $ sudo aptitude install apache2
    $ sudo aptitude install php5
    $ sudo aptitude install mysql-server
    $ sudo aptitude install php5-mysql
    Once these are installed, you should be able to test it by pointing your web-browser to:
    http://localhost/

    You should see a web-page, not an error message. (You may see a simple web-dir listing with "apache2-default" in it... that's normal.) To test if PHP is working properly, just create a simple test page. For instance, create a file:
    Code:
    $ sudo nano /var/www/test.php
    And put in this text:
    Code:
    <html>
    <head>
      <title>Test Page</title>
    </head>
    <body>
    Test page<br />
    <?php 
    	echo 'If you can see this text, then PHP is working.';
    ?>
    </body>
    </html>
    Then go to http://localhost/test.php
    If you see the "...then PHP is working" message then all is well.

    Since your PHP/MySQL interface will eventually be world-accessible, it makes sense to put some security in place. By default MySQL starts with no password, so you should certainly set one:
    Code:
    $ mysqladmin -uroot password 'new-password'
    (Note: if you're ever having trouble coming up with good passwords, install and run a simple commandline program called "pwgen" ... it will suggest strong passwords that are reasonably easy to remember.)


    Step 2: Make sure you can access your webserver.

    A common stumbling block in getting a LAMP stack fully functional is that port 80 is blocked. This may be because the Internet Service Provider (ISP) is blocking it, or because your router's firewall is blocking it. To test whether or not you are blocked, first find out your world-facing ("external") IP address. You can do this in any number of ways, such as visiting sites like:
    http://www.ipaddressworld.com/

    Then test your setup by using a web browser to check:
    http://localhost/
    http://xxx.xxx.xxx.xxx/

    (Where the x's are your IP address, of course.) If you see the same apache page in both cases, then everything is working. If in the second case you get an erorrt, then somewhere along the line port 80 is being blocked. It could be your ISP, or the firewall in your router (if any).


    2.a Opening up port 80 on a router.

    If you have a router, you should log into it and open up port 80. First find out your local IP address (the one inside your local network). To do this just type:
    Code:
    $ ifconfig
    Among other things, you should see something like "inet addr:192.168.1.101" (usually in the first block of output, marked "eth0"). That is your internal IP address.

    Then access your router's administration mode. Typically you access your router by using a web-browser and going to "http://192.168.1.1/" or "http://192.168.15.1/" or some other "special address" like that. You will need to find the documentation for your specific router. You will probably also have to enter a username and password to get access to the router admin page.

    Once there, you will need to find a section marked "Application & Gaming" or "Port Forwarding" or something similar. In this section, you should set up a new rule along the lines of:
    Code:
    name: http
    port start: 80
    port end: 80
    type (TCP/UDP/Both): Both
    Forward to: 192.168.1.101
    Enabled: Yes
    Needless to say, you should replace the "192.168.1.101" in the above example with the internal IP address you determined previously. You may need to restart the router for changes to take effect (simply unplugging it for a few seconds should work).

    Then you should test again by visiting your *external* IP address:
    http://xxx.xxx.xxx.xxx/


    2.b Using a non-standard port.
    If the above did not work, then it is likely that port 80 is being blocked by your ISP. Many residential ISPs will block port 80 (the standard port for http web requests), so you may need to use a non-standard port. Doing so is relatively simple, however. First edit the configuration for your webserver:
    Code:
    $ sudo nano /etc/apache2/apache2.conf
    And add a line that says:
    Code:
    Listen 8080
    The "8080" is the non-standard port we will use. You can pick any port you want, as long as it is greater than 1024 (low ports are reserved and probably also blocked). You need to restart apache for hte change to take effect:
    Code:
    $ sudo /etc/init.d/apache2 restart
    Then modify your router to allow port 8080 to be forwarded to your computer. Use the guidelines given above (section 2.a), except put "8080" instead of "80".

    After doing this, test your webserver by going to:
    http://localhost:8080/
    http://xxx.xxx.xxx.xxx:8080/

    In both cases you should get to your apache page, like before. If this doesn't work then go back over the steps and double-check what you've done. It may also be that your router doesn't support port-forwarding properly. In some cases you can "flash the firmware" on your router to fix the problem.


    Step 3: Get Torrent-Flux

    Now you can go download torrentflux:
    http://www.torrentflux.com/

    The files are hosted by SourceForge:
    http://prdownloads.sourceforge.net/t...ar.gz?download

    Once the file is downloaded, you can untar it in the usual way:
    Code:
    $ tar -xvzf torrentflux_2.1.tar.gz
    Inside the newly-created "torrentflux_2.1/" directory, you will find a file called "INSTALL" with detailed instructions of what to do next. We'll now go through those steps.


    Step 4: Install Torrent-Flux

    4.a Copy files.
    Torrent-flux is 'simply' a bunch of PHP files (server-interpreted web-files). For them to work, all you really need to do is copy them into your web-folder:
    Code:
    $ sudo mkdir /var/www/torrentflux/
    $ sudo chown user:user /var/www/torrentflux/
    $ cd ~/Desktop/torrentflux_2.1/html/
    $ cp -r * /var/www/torrentflux/
    Instead of user:user you should put your username and group. (They are usually the same, and are simply the name you login with.) The above "cd" command will vary depending on where you untared the files.

    4.b MySQL.
    We also need MySQL setup properly. Create a database for torrentflux:
    Code:
    $ mysqladmin -uroot -p create torrentflux
    (You'll need to enter the MySQL password you set previously.) Now go into the "sql" sub-directory in torrentflux (depends on where you untared torrentflux, of course):
    Code:
    $ cd ~/Desktop/torrentflux_2.1/sql
    And upload the torrentflux structure to MySQL:
    Code:
    $ mysql -uroot -p torrentflux < mysql_torrentflux.sql
    If you don't like using MySQL on the commandline, you can install a program called "phpmyadmin" that gives you easy web-browser access to all of the functionality in MySQL. Once installed, you access it by pointing your web-browser to: http://localhost/phpmyadmin/

    Now you need to tell torrentflux the password you set for your MySQL system. So you edit the file:
    Code:
    $ sudo nano /var/www/torrentflux/config.php
    Near the top of the file, you'll see lines that read:
    Code:
    $cfg["db_user"] = "root";        // username for your MySQL database
    $cfg["db_pass"] = "";            // password for database
    You can modify the "db_pass" line with the password you selected before.

    4.c New MySQL User
    For added security/control, you may prefer to give torrentflux a "non-root" MySQL access. This can be important if you have lots of different applications all using MySQL. To do this, you can use "phpmyadmin" or enter these commands one at a time:
    Code:
    $ mysql -uroot -p
    mysql> use mysql;
    mysql> INSERT INTO user (Host,User,Password) VALUES('localhost','torfluxuser',PASSWORD('secret'));
    mysql> FLUSH PRIVILEGES;
    mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON torrentflux.* TO 'torfluxuser'@'localhost';
    mysql> exit;
    Of course instead of 'secret' you should use better password. Now you edit the torrentflux configuration:
    Code:
    $ sudo nano /var/www/torrentflux/config.php
    And update the lines:
    Code:
    $cfg["db_user"] = "torfluxuser";        // username for your MySQL database
    $cfg["db_pass"] = "secret";            // password for database
    Obviously you can call your torrentflux user whatever you want, and set the password to whatever you like. Just make sure that the entry in MySQL and in torrentflux match!


    4.d First login.
    Now you can go to your torrentflux page, using a web-browser:
    http://localhost/torrentflux/

    On your first login you the username and password you supply will be the "administrator account" for torrentflux. Make sure you rememeber the password! (It doesn't have to match the MySQL password you created before.)

    You should then be taken to a page where you can configure torrentflux. In particular, the first line (path) will be marked with an error:
    "Path is not Writable -- make sure you chmod +w this path"
    You need to change permissions on the download folder:
    Code:
    $ sudo chmod 777 /var/www/torrentflux/downloads/
    You should look over the rest of the settings too. Note that "Port Range" is an important parameter for efficient bit-torrent. You should pick some range (like 45000-46000), and then open up the corresponding range on your router (if any). By allowing connections on that range, you will be able to connect to a larger swarm during downloading, which increases download speed considerably.

    Step 5: Dynamic IP

    If you have a static IP address, you can skip this step. However most home users have a dynamic IP, meaning that it changes every so often (whenever your ISP feels like it, which may be every day or every couple of months). Thus to connect to your torrentflux remotely, you won't know what IP address to go to. A convenient solution is to use a "domain redirect" service. Basically this service will give you an easy to remember alias, like "user.example.com" which will get you to your machine. In order to have the IP conveniently updated, there are programs that can update your domain redirect automatically.

    There are companies that offer free domain redirection services. An extensive list can be found here:
    http://www.technopagan.org/dynamic/#TheList
    The two most popular are DynDNS:
    http://www.dyndns.com/services/dns/dyndns/
    and noip:
    http://www.no-ip.com/services/manage...namic_dns.html

    This tutorial will use "noip" as an example. Similar procedures would apply to other services. I've used noip for quite awhile now, and their service is excellent. You can create a new account:
    http://www.no-ip.com/newUser.php

    Then you can login to "Your No-IP" and go "Add" to create a new host. You get to select the prefix (whatever you want) and select a list of domains from those that No-IP manages. You can then enter your current IP address (usually auto-detected). Let's say you selected "user.no-ip.info". After adding the new host (and waiting a few minutes), you should be able to access your torrentflux using:
    http://user.no-ip.info/torrentflux/
    or
    http://user.no-ip.info:8080/torrentflux/
    (if you used a custom port, above).

    Of course the real problem with a dynamic IP is that it changes without notice. For this, No-IP provides a piece of software (go to the "Download" section and select "Linux/BSD/Unix"):
    http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
    As before, you need to untar the file, and enter the new directory:
    Code:
    $ tar -xvzf noip-duc-linux.tar.gz
    $ cd noip-2.1.3/
    If you are running an "i686 machine" (i.e.: any recent standard desktop PC), then do this:
    Code:
    $ cp binaries/noip2-Linux noip2
    $ sudo make install
    And answer the questions (using the email/password that you created the noip account with). The update interval is in minutes (default 30 minutes is fine).

    If you are not running an i686 machine (PowerPC, etc.) then you will need to compile the program. If you don't have compilers installed, then install them:
    Code:
    $ sudo aptitude install build-essential
    To compile, while in the "noip2-2.1.3/" direction, just do:
    Code:
    $ make
    $ sudo make install
    In either case, you can now run noip by typing:
    Code:
    $ sudo noip2
    To make sure that noip starts everytime the computer boots, edit the file "rc.local" in the "/etc/" directory (note that there is another version of rc.local in "/etc/init.d" but that's not the one you want to edit!):
    Code:
    $ sudo nano /etc/rc.local
    And add a line:
    Code:
    /usr/local/bin/noip2 &
    Be sure to put this line *before* the "exit 0" line at the end!

    Now noip will always be running when the computer is turned on, and it will update the your domain name frequently, so that when you go to "http://user.no-ip.info/torrentflux/" you get to your own pesonal torrentflux application.


    Step 6: Adding Search Modules
    Another neat feature of torrentflux is that it centralizes your torrent searching. You can add modules to torrentflux that enable it to use the search facilities on a number of different trackers. A few modules are given as examples. Other modules are are available on the torrentflux forums:
    http://www.torrentflux.com/forum/

    To add a new module, simply download the file, and move it into the "searchEngines" folder:
    Code:
    $ mv module.php /var/www/searchEngines/
    Conclusion
    Hopefully this how-to will be of use to others. I followed these steps on a fresh install of Kubuntu 6.06 and it worked fine.
    Last edited by kebes; September 3rd, 2007 at 02:28 AM. Reason: typo in "cd" command

  2. #2
    Join Date
    Dec 2005
    Location
    Vancouver, BC
    Beans
    283
    Distro
    Hardy Heron (Ubuntu Development)

    Re: How-to: Installing Torrent-Flux

    I get this error, after doing this howto, I am using the dapper server edition,

    HTML Code:
    Fatal error: Call to undefined function mysql_connect() in /var/www/adodb/drivers/adodb-mysql.inc.php on line 354

  3. #3
    Join Date
    Apr 2005
    Location
    Exeter, UK
    Beans
    12
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: How-to: Installing Torrent-Flux

    Code:
    $ sudo aptitude install php5-mysql
    Should sort you out.

  4. #4
    Join Date
    Sep 2006
    Location
    Vancouver, BC, Canada
    Beans
    30
    Distro
    Ubuntu 6.10 Edgy

    Re: How-to: Installing Torrent-Flux

    Hmmm... I am getting the same error, and i made sure that i have all necessary components
    Fatal error: Call to undefined function mysql_connect() in
    /var/www/torrentflux/adodb/drivers/adodb-mysql.inc.php on line 354
    I am running PHP5 and Apache2, I am sure that mysql can be accessed (i am also running Gallery1 so i am sure that it is running fine.)

    Anyone have any ideas what i may be forgetting?

  5. #5
    Join Date
    Sep 2006
    Location
    Vancouver, BC, Canada
    Beans
    30
    Distro
    Ubuntu 6.10 Edgy

    Re: How-to: Installing Torrent-Flux

    Problem solved, I did a little digging around and found this:
    Fatal error: Call to undefined function: mysql_connect() in /var/www/html/adodb/drivers/adodb-mysql.inc.php on line 354
    This means that your version of php can't connect to the mysql database. Usually installing a package like php-mysql will solve this although if it doesn't then open your php.ini file and find the line like extension=mysql.so, remove the comment from in front, and then restart your webserver.
    from the official FAQ which can be found here:

    http://www.torrentflux.com/forum/ind...ic,1451.0.html

    So i did the following:
    sudo gedit /etc/php5/apache2/php.ini
    to remove the comment from the extension=mysql.so (line 565) and restart apache.
    sudo /etc/init.d/apache2 restart

  6. #6
    Join Date
    Aug 2006
    Beans
    5

    Re: How-to: Installing Torrent-Flux

    if i try do go to http://localhost/test.php, obtain this message

    Code:
     Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
     
     Warning: Unknown: Failed opening '/var/www/test.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
    if i try
    Code:
    sudo /etc/init.d/apache2 start
    * Starting apache 2.0 web server...                                   
    apache2: Could not determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    httpd (pid 6243) already running
                                                                                                                           [ ok ]
    please, i'm very newbie, any ideas???

    tks a lot

  7. #7
    Join Date
    Jan 2007
    Beans
    1

    Re: How-to: Installing Torrent-Flux

    Hey, I'm having a few issues. I tried to install torrentflux last night and it borked out during the installation at the process of setting up the SQL database. I hadn't really thuoght about it and I just did:
    sudo aptitude install torrentflux

    and let it run etc. But yeah, it didn't finish, gave me some error which I should have, but didn't copy. I thought I would have a look for a readme such as this one and I started doing the instructions to install apache:
    sudo aptitude install apache2

    and I get:
    The following packages have been automatically kept back:
    beryl-core beryl-manager beryl-plugins beryl-plugins-data beryl-settings
    emerald
    The following NEW packages will be automatically installed:
    apache2-common apache2-mpm-worker apache2-utils libapr0 libpcre3
    The following packages will be automatically REMOVED:
    torrentflux
    The following packages have been kept back:
    dbus dbus-1-utils libdbus-1-3 libglu1-mesa libwnck-common libwnck18
    libxss1 mesa-utils xserver-xgl
    The following NEW packages will be installed:
    apache2 apache2-common apache2-mpm-worker apache2-utils libapr0 libpcre3
    The following packages will be REMOVED:
    torrentflux
    0 packages upgraded, 6 newly installed, 1 to remove and 15 not upgraded.
    Need to get 0B/1457kB of archives. After unpacking 1962kB will be used.
    Do you want to continue? [Y/n/?] y
    Writing extended state information... Done
    (Reading database ... 91618 files and directories currently installed.)
    Removing torrentflux ...
    .: 7: Can't open /usr/share/dbconfig-common/dpkg/prerm.mysql
    dpkg: error processing torrentflux (--remove):
    subprocess pre-removal script returned error exit status 2
    .: 7: Can't open /usr/share/dbconfig-common/dpkg/config.mysql
    dpkg: error while cleaning up:
    subprocess post-installation script returned error exit status 2
    Errors were encountered while processing:
    torrentflux
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:


    So, I figured maybe I should manually remove torrentflux first:
    sudo aptitude remove torrentflux
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Reading extended state information
    Initializing package states... Done
    Building tag database... Done
    The following packages have been automatically kept back:
    beryl-core beryl-manager beryl-plugins beryl-plugins-data beryl-settings
    emerald
    The following packages have been kept back:
    dbus dbus-1-utils libdbus-1-3 libglu1-mesa libwnck-common libwnck18
    libxss1 mesa-utils xserver-xgl
    The following packages will be REMOVED:
    torrentflux
    0 packages upgraded, 0 newly installed, 1 to remove and 15 not upgraded.
    Need to get 0B of archives. After unpacking 2753kB will be freed.
    Writing extended state information... Done
    (Reading database ... 91618 files and directories currently installed.)
    Removing torrentflux ...
    .: 7: Can't open /usr/share/dbconfig-common/dpkg/prerm.mysql
    dpkg: error processing torrentflux (--remove):
    subprocess pre-removal script returned error exit status 2
    .: 7: Can't open /usr/share/dbconfig-common/dpkg/config.mysql
    dpkg: error while cleaning up:
    subprocess post-installation script returned error exit status 2
    Errors were encountered while processing:
    torrentflux
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:

    and I get the same error . Any ideas?

  8. #8
    Join Date
    Aug 2006
    Beans
    923
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: How-to: Installing Torrent-Flux

    Quote Originally Posted by det0r View Post
    and I get the same error . Any ideas?
    First thing to try:
    sudo dpkg --purge torrentflux
    sudo aptitude remove torrentflux

    You can also check on package status:
    dpkg -l torrentflux

    (might give a clue as to the state the package is in...)
    Last edited by kebes; January 6th, 2007 at 04:00 AM. Reason: added dpkg -l suggestion

  9. #9
    Join Date
    Dec 2005
    Beans
    5

    Re: How-to: Installing Torrent-Flux

    When I go to http://locahost/torrentfluxi I get error like this
    Warning: include_once(adodb/adodb.inc.php) [function.include-once]: failed to open stream: Permission denied in /var/www/torrentflux/db.php on line 5

    Warning: include_once() [function.include]: Failed opening 'adodb/adodb.inc.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/torrentflux/db.php on line 5

    Fatal error: Call to undefined function NewADOConnection() in /var/www/torrentflux/db.php on line 12

    please help me, Any ideas?

  10. #10
    Join Date
    Aug 2006
    Beans
    923
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: How-to: Installing Torrent-Flux

    Quote Originally Posted by ubuman View Post
    Warning: include_once(adodb/adodb.inc.php) [function.include-once]: failed to open stream: Permission denied in /var/www/torrentflux/db.php on line 5
    It might be a permissions problem. Go to your torrentflux directory and check what the permissions are:

    Code:
    cd /var/www/torrentflux/
    ls -laF
    The files should be owned by some user and group (not root:root), and the files should be world readable. So it should look like this:
    Code:
    bob@computer:/var/www/torrentflux$ ls -laF
    total 568
    -rwxr--r--  1 bob bob 83995 2006-09-30 23:38 admin.php*
    drwxr-xr-x 11 bob bob 4096 2006-09-30 23:38 adodb/
    -rwxr--r--  1 bob bob 5471 2006-09-30 23:38 AliasFile.php*
    etc....
    If you instead see something like:
    Code:
    -rwx------  1 bob bob 83995 2006-09-30 23:38 admin.php*
    drwx------ 11 bob bob 4096 2006-09-30 23:38 adodb/
    -rwx------  1 bob bob 5471 2006-09-30 23:38 AliasFile.php*
    Notice the "-rwx------". The last three positions specify world-privileges. Then that means that the permissions are too strict (the web browser cannot read the files). You can change them by going:

    Code:
    chomod 744 * -R
    ...which will make all the files (and sub-dirs) world-readable.


    If that's not the problem, then maybe when you copied the torrentflux files over, you didn't copy sub-directories? Go check the directory "/var/www/torrentflux/adodb", by going:
    Code:
    cd /var/www/torrentflux/adodb/
    ls -laF
    Do you see any files? If not, then when you did the copy command to put the files there, you forgot the "-r" that makes it recursive! Go back a few steps and make sure you've copied everything!

    Good luck!

Page 1 of 4 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •