PDA

View Full Version : Super Simple Bluehost Torrent Flux Installation Guide


aceofspades
05-19-2007, 08:29 PM
Ok torrent flux is an AWESOME PHP application that allows you to host bittornado (one of the fastest bittorent applications) on your web server. It even allows you to create limited users so you can provide public access. It works splendidly on bluehost and requires no extra configuration!!!

Ok what do u need. Let me give u the run through for BH.


Download torrent flux for linux. http://torrentflux.com
Extract
Make a new db (or use an existing one) and go to phpadmin and import the sql file in the sql dir.
Go to the html dir and edit the config.php. Just put ur db information and leave everything untouched
Archive and rename the html dir (zip, tar.gz, .tar) and upload through file manager to the dir u want.
Extract
Go to the dir
Type in your username and admin (anything you want. This will automatically become a superadmin)
Thats it :eek:
i just wanted to add an extra step:confused:
WARNING
Change your downloads directory to something outside of your public_html folder. You may not want bots crawling it and you can download it from inside torrent flux using the file explorer.

TinyLnk
05-19-2007, 09:34 PM
sounds like something that'l get people in trouble :|

Falcon4
05-19-2007, 10:02 PM
I. ****ing. Love. You.

I didn't know you could run that on BH!!

Oh man. BH is gonna cringe. XD

edit: Hehe! If this thing lets me create and seed torrents from paths on the server as well, this is gonna make backups SO MUCH EASIER!!!

TinyLnk
05-19-2007, 10:21 PM
seed backups.. err no comment

Falcon4
05-19-2007, 10:42 PM
seed backups.. err no comment

Yeah, I know your comment. "How insecure is that??!?!!!". The answer is, very! Especially when all you're backing up is public data anyway... :P

Falcon4
05-19-2007, 10:56 PM
Turns out that Bluehost's Apache implementation is going to keep Torrentflux from working properly... so we're screwed :'(

Sure would be nice though.

Falcon4
05-19-2007, 11:29 PM
But that won't stop me.

http://hostfile.org/thumbs/L_TorrentFlux.png.png (http://hostfile.org/TorrentFlux.png)

Turns out that Bluehost blocks outgoing connections on all but port 80 (it seems!), so it doesn't work too well unless your clients are set up really tricky. Plus, the server stops the Python program every few seconds, so the torrent's always "dying". Pain in the ass but it might just be worth the trouble for lack of a better backup protocol!

TinyLnk
05-20-2007, 01:29 AM
lol surely you can come up with a better way -.-

lazynitwit
05-20-2007, 10:37 AM
lol surely you can come up with a better way -.-


Of course there's a better way: Get a dedicated IP.

I'm not sure how well running a tracker at bluehost would work, especially since they have the whole CPU Limitations setup and torrent trackers can tend to use quite a bit of resources.

aceofspades
05-20-2007, 10:41 AM
But that won't stop me.

http://hostfile.org/thumbs/L_TorrentFlux.png.png (http://hostfile.org/TorrentFlux.png)

Turns out that Bluehost blocks outgoing connections on all but port 80 (it seems!), so it doesn't work too well unless your clients are set up really tricky. Plus, the server stops the Python program every few seconds, so the torrent's always "dying". Pain in the ass but it might just be worth the trouble for lack of a better backup protocol!


Than explain to me how i was able to download 50 gB worth of torrents. Yea 50 GB of public domain software (windows VISTA is public domain right JK :rolleyes: ).

I just love how they cant even take screenshots of their own program without blanking out the whole page. Yea i really doubt that ever AVI file there was linux tutorials :D

Anyways I have NO CLUE what your talking about. Oh and dont run queue manager because BH kills it every once in a while.

Seriosly i have no clue what u mean it works. But u do need to restart torrents a lot. But hey still better than running off my home computer :D .

Dont forget to ge tthe AJAX hack.

I recommend you put the downloads dir in something outside of public_html. And u can retrieve the stuff via the directory viewer (it allows u to download dirs as .zip or .tar)

aceofspades
05-20-2007, 10:56 AM
Here is the screenshot that proves you wrong.

I had to do A LOT OF BACKUPS :D

http://3m2.net/photos/torrentflux.png

TinyLnk
05-20-2007, 12:08 PM
where do you get the backups from o.o they arent in my root dir :(

TinyLnk
05-20-2007, 12:09 PM
oh yea and i read somewhere that you need a static ip to make outboud connections

aceofspades
05-20-2007, 12:57 PM
oh yea and i read somewhere that you need a static ip to make outboud connections
i have a static IP. But when i try to bind it it doesnt work.:(

Falcon4
05-20-2007, 04:25 PM
Than explain to me how i was able to download 50 gB worth of torrents. Yea 50 GB of public domain software (windows VISTA is public domain right JK :rolleyes: ).
...
...
Anyways I have NO CLUE what your talking about. Oh and dont run queue manager because BH kills it every once in a while.

Seriosly i have no clue what u mean it works. But u do need to restart torrents a lot. But hey still better than running off my home computer :D .


Okay, first you say you have no idea what I'm saying, then you say yourself exactly what I'm saying: torrents don't even RUN long enough to download! >.<

aceofspades
05-20-2007, 04:40 PM
Okay, first you say you have no idea what I'm saying, then you say yourself exactly what I'm saying: torrents don't even RUN long enough to download! >.<
dude im pretty sure they do because as u can see i just downloaded like 40 GB worth of stuff. Many of that stuff took days :p

Falcon4
05-20-2007, 06:20 PM
WTF? Can you even read or write? YOU YOURSELF said it didn't work!!!!!!

UGH!

aceofspades
05-21-2007, 05:52 AM
when???? I said it did work? Eesh calm down. I am saying it does work. You just gotta get the hang of it.

Just get firfox open a new tab for each torrent and than when all your torrent torrents die (only happens like once an hour) right lcick and press RELOAD ALL

Also works in IE7

hofmax
05-21-2007, 06:23 AM
Sure enough that's an interesting program but I'm sure it will soon be disallowed. If you have only a couple of users on each box downloading (and storing....) gigs of data that will fill up the box hd pretty quickly.

Basil
05-21-2007, 07:42 AM
lol @ upload speed

Falcon4
05-21-2007, 12:27 PM
when???? I said it did work? Eesh calm down. I am saying it does work. You just gotta get the hang of it.

Just get firfox open a new tab for each torrent and than when all your torrent torrents die (only happens like once an hour) right lcick and press RELOAD ALL

Also works in IE7

The page will show in whatever browser you care to open it in. The problem is, the box won't let the program itself (the torrent client, a Python script) run for more than 1 minute at a time. So it kills the tasks and the torrents "die"...

aceofspades
05-21-2007, 12:53 PM
ok than why am i able to download so much stuff? Obviously i wouldnt have 300 MB download and 1.7Up in one day...just on my demonoid torrents.

lets just put it this way. I am able to download 30 times faster than at home + everyone doesnt want to wring my neck for ruining their internet.

LOL I just like to append .avi, keygen, and crack to the end of my torrents cause it helps me sort them.

They die once in a while but certainly not every minute!

aceofspades
05-21-2007, 01:02 PM
300 gb is a mighty bit thing to fill (especailly on bittorentwhere u go nuts to see 20 Kb/s download)so anyway i bt it than download it and remove. No biggy.

Anyways what do they care. If my bandiwidth runs out thats my problem. If my space runs out thats my problem. If it takes up too much CPU (which odly enough it hasnt) it will just be me getting annoying messages. It doesnt effect ANYONE else.

Falcon4
05-21-2007, 01:46 PM
It Does. Not. Work. Do you want me to make a video of my torrents dying every minute on the minute? The server kills the scripts.

hofmax
05-21-2007, 01:52 PM
Yes, but every box only has a physical storage capacity of 2 * 500 GB I was told. So imagine what would happen if 10 people on a box try to fill up their allocated storage of 300 GB each....

Falcon4
05-21-2007, 02:01 PM
Yeah, but that could be resolved easily by going after people that are using their boxes to torrent illegal software (e.g. Ace). I'm using it as a error-proof, streamlined way to move my delete_files archive from the server to my desktop for cross-referencing and burning. Otherwise it's FTP, and I really, really, really hate FTP. A simple "rnfr"/"rnto" in FTP moves the directory into the torrent folder, then TorrentFlux creates the .torrent file out of all the data, right on the server. Then I download the torrent, start it on my home PC, then start it on the server, and the data just flows at a billion KB/s.

Problem is, it only does this for a minute before the server says "Okay, enough of that ****" and kills the torrent. I'm trying to look up Python information on how to work around this one-minute limitation. The TorrentFlux FAQ says that when Apache dies, Python dies as well - and Apache is constantly being cycled on Bluehost servers. Therein lies the problem. I might have to find a way to make a long-running PHP script that always resets the counter, then waits 30 seconds, resets the timer, waits another 30 seconds...

Falcon4
05-21-2007, 02:29 PM
Okay, I think I may have figured it out. It's still running in the background as long as my PHP script keeps running in a sleep/set_time_limit loop.

When TorrentFlux runs the Python command, it appends a "nohup" and "&" to the line. "nohup" apparently makes it not take any input/output or call any exceptions. The "&" detaches it from the webserver process. The server saw these detached processes, and shut them down! It's good server maintenance, but not good for torrenting.

So I removed those two lines and made a small PHP script of my own...

<?php
passthru('cd /home/hostfile/torrent/falcon4; HOME=/home/hostfile/torrent/; export HOME; \'/usr/local/bin/python2.4\' -OO \'/home/hostfile/public_html/flux/TF_BitTornado/btphptornado.py\' \'False\' \'150\' \'/home/hostfile/torrent/.torrents/delete_files.stat\' falcon4 --responsefile \'/home/hostfile/torrent/.torrents/delete_files.torrent\' --display_interval 5 --max_download_rate \'0\' --max_upload_rate \'0\' --max_uploads \'4\' --minport \'49160\' --maxport \'49300\' --rerequest_interval \'1800\' --super_seeder \'0\' > /dev/null');
for($x=0;$x<10;$x++) {
sleep(30);
set_time_limit(45);
}
?>

... in a test-script-runner of course. It currently runs for 5 minutes at a time as opposed to the previous 1 minute limitation. I'm happy ^_^

edit: Hrm, well, my script ended, and the Python program is still running! I guess I might just be able to actually remove the "&" from the line and keep it attached to the TorrentFlux script... that may work =)

aceofspades
05-21-2007, 04:14 PM
nice thanks right now it works for me with mixed results. I found out that as soon as you go over 9 torrents the whole thing dies. Anyways ive been going for about 20 minutes strong. What is the big problem? But it could DEFINETELY USE some tweaks. Dont forget to get the AJax mod it will REALLYsave ur life.

And no u dont use FTP. It has a build in file explorer and since torrents come in folders (those annoying demonoid files are SO bothersome) u can download as a .zip.

Definetly if you do ANYTHING that fixes anything dont forget to pm me!

aceofspades
05-21-2007, 04:19 PM
right now im trying to get b4rt-torrentflux because it has some promising items like support for other clients (transmission, orginal, and azerus) and other cool stuff like auto-restarters

Falcon4
05-21-2007, 04:32 PM
Ugh. You don't seem to have a real understanding of English language mechanics. Is English your second language or something? I'm asking that in all seriousness because I'm having a really hard time relaying concepts to you in the forums; I keep getting back responses that tell me you're only reading half the sentence or something.

FTP is used to move a folder into the torrent folder, not to download the **** things. I can't coax TorrentFlux into making a torrent from a folder outside the torrent path without hacking up the script a bit. But I can sort-of see how it all works.

I don't know how you managed to get it working on your box. Maybe Bluehost has things set up differently on that box. On mine, "unattached" processes die within a minute. And now I'm having trouble getting it to run again at all. The trick I did above doesn't work anymore. It just crashes.

If I could get the thing to run for even an hour at a time, I would be ***SOOOOOOO*** happy!!!

aceofspades
05-21-2007, 04:35 PM
i wake up and the thing is still running. I did the basic installed and havent done anything special. Edit:(WOW MY GRAMMAR IS BAD)

Edit: I did the basic install and I have not done anything special.

YOU CANNOT RUN MORE THAN 9 TORRENTS THEY WILL DIE INSTANYTLY.

But yea that is wierd. What verision of PHP do you have?

English is my second language and I don't have a first

LOL JK I just am in a rush to post on Forum


Edit: Do you know whats wierd. When my torrents die most of the time there is one guy that just keeps on trucking and refuses to die.

Falcon4
05-21-2007, 04:44 PM
lol.

I'm just trying to get one single torrent to run. Just chatted it up with BH support (somewhat daft as usual, but informative: 20 seconds of CPU time per minute, and 20 processes maximum), and came out with a small piece of information, that all the boxes are configured pretty much the same way. Still doesn't explain why it kills those processes though.

I'm still hard at work figuring out how to make it work again. It worked once, so there's GOT to be a way to make it work again!

aceofspades
05-21-2007, 04:50 PM
its working great right now. Having fun downloading pointless things ill never used. Im just like downloading some uber defrager, it most be good if it has 400 seeds and 500 leeches, maybe it moves around ur hardrive and feeds it strawberries at the same time.

Well anyways nothing but success on my side. You just dont understand how good its working.

On the CPU front:

Dude all i know is why i try to start 11 torrents all i see is an endless row of torrent died.

Falcon, do u have a static IP?

EDIT: SRY MY SPACE BAR IS BAD. That is why i keep grouping words

Anyways i downloaded 127 mb in like 10 min. Not bad by bt standards

Falcon4
05-21-2007, 05:05 PM
Static or otherwise, it doesn't matter. I don't even know. I'm guessing that being on a shared "box" I have a static IP. It would cost too much in DNS management cost to not be on a static IP.

Still trying to figure out what keeps making the program halt... >.<

aceofspades
05-21-2007, 05:26 PM
no i mean did u buy an IP. You pay an extra 30 bucks a year. That may be what is makingthe difference. They dont kill my scripts because people with nonShared IPs dont get their scripts killed.

I think that iswhat is making the difference.

Sorry, and sorry for the word grouping

Yup sorry that is your issue. i got my IP for TeamSpeak. And than my friends never used it and I almost kicked their as* for making me pay 30 bucks. Now I know why having a dynamic IP is sweet!

Sorry to put you down but without a dedicated IP it will never work. That is the difference. If you read the knowledge base it will tell u that.

Falcon4
05-21-2007, 05:32 PM
XD

No, it's nothing about a static IP! I never paid for that, nor even knew it was an option, but I found out what the problem is.

Check this blip out...


<?php
// find out if any screens are running and take their PID and make a KILL option
foreach ($runningTorrents as $key => $value)
{
$rt = new RunningTorrent($value);
if ($rt->statFile == $alias) {
if ($kill_id == "")
{
$kill_id = $rt->processId;
}
else
{
// there is more than one PID for this torrent
// Add it so it can be killed as well.
$kill_id .= "|".$rt->processId;
}
}
}

// Check to see if we have a pid without a process.
if (is_file($cfg["torrent_file_path"].$alias.".pid") && empty($kill_id))
{
// died outside of tf and pid still exists.
@unlink($cfg["torrent_file_path"].$alias.".pid");

if(($af->percent_done < 100) && ($af->percent_done >= 0))
{
// The file is not running and the percent done needs to be changed
$af->percent_done = ($af->percent_done+100)*-1;
}

$af->running = "0";
$af->time_left = "Torrent Died";
$af->up_speed = "";
$af->down_speed = "";
// write over the status file so that we can display a new status
$af->WriteFile();
}
?>

This little snip of code from the index.php's torrent-enumeration function (contained in functions.php) actually goes through the trouble of killing the torrents itself if it isn't given access to finding the torrent's PID! So my little hack of forever-running a process didn't work because every time I reloaded the front page, the script would kill off the torrent. Now it's working fine in the background, but I can't watch the status because if I do, this piece of code will kill it (and I'm really enjoying the 250KB/s download from the server to my laptop, so I don't want to mess it up).

Maybe Bluehost provides more "lax" security settings when you pay extra, or a more "lax" configured server. I dunno, really. But it seems that my box (as well as most of BH's customers) is configured differently, causing problems like this.

At any rate, I have one torrent running! Yaaah me! :D

edit edit: It looks like these Bluehost boxes are only able to make outgoing connections on a limited number of ports - from what I've seen, 80, 21, and maybe some others, in particular. So its usefulness for BitTorrent is somewhat limited and requires customized configurations on your client system as well. But it's still definitely pretty useful for backing up! :P

aceofspades
05-21-2007, 05:55 PM
can upost it as a file?

But yes a dedicated IP makes A HUGE difference. even if u get itrunnign it will still run not quite as optomilly.

THX FOR THE SCRIPTS. Maybe u can post them on the TF hacks forum! U saved my life dude. Please put it in a fileI will really apreciate it.

BTW u will probobly not be able to run torrentflux without a dedicated IP because

You cant make outgoing connections on ports other than 80 and 21
Your scripts getkilled after about 100 seconds
You would be interfering with other people (probobly not in a large way but you would affect others)Trust me with an IP torrent flux works like a dream (maybe one ofthose alright dreams where everything doesnt work perfectly but it achieves the end result)


DARN WORDGROUPING

Falcon4
05-21-2007, 06:01 PM
Huh? No, I don't think... no. None of the things I've done will fix your server's problems! They're just to work around the limitations of my ghetto 7 bucks a month shared hosting :-)

It seems that this implementation is horribly limited to a small number of applications - in particular, doing a server backup. Anything else... well. I'm trying to download a single popular torrent and I'm getting nowhere because most peers aren't port 80 or 21. It's really limited.

But even with all those limitations, it's a hell of a lot better than FTP! It's error-proof, and fast. FTP is ghetto as hell!

aceofspades
05-21-2007, 06:09 PM
yea but it will still help me becausemy torrens dierandomly. I have the same ghetto plan buti sprang for the extra 30 bucks because a friend really wantedTS but than the idiot never used it.

But PLS post them as files. Why does everyone gotta be crazy and notpost anything as a file LOL.



----


LOL I Also have tons of backups. You know i just gotta backup all my.avi files ;).



FTP SUCKS. I use the cpanel program and it is a lot better. Just putthem as .tar.bz2 (the most compressed native archive)

----

If u really want ill make u an account on mine. You can make "backups" of your favorite .avi files.

Isnt .avi a great archiving solution!

Falcon4
05-21-2007, 06:13 PM
Huh?

Post what as a file?

No, nothing I wrote was a "fix" of any kind. Your torrents dying randomly is not something I can fix. The things I'm doing now are hacks that pretty much only I can use, and even these are dying on me. The reason I'm using them is because now it runs for more than 1 minute at a time - more along the lines of up to 10 minutes now. Nothing is a "fix"...

aceofspades
05-21-2007, 06:17 PM
well anyways good luck.

I got to download anyother10 GB of "backups"

To think that some people pay 12 bucks a month for a basic 20 GB of transfer and 20 GB of space torrentflux hosting. Do a google search for "torrentflux hosting".

2.50 a month seems reasonable when I can get such awesome stuff.

Current Download:179.40 kB/skB/s Current Upload:843.00 kB/

anyways where do u put

<?php
passthru('cd /home/hostfile/torrent/falcon4; HOME=/home/hostfile/torrent/; export HOME; \'/usr/local/bin/python2.4\' -OO \'/home/hostfile/public_html/flux/TF_BitTornado/btphptornado.py\' \'False\' \'150\' \'/home/hostfile/torrent/.torrents/delete_files.stat\' falcon4 --responsefile \'/home/hostfile/torrent/.torrents/delete_files.torrent\' --display_interval 5 --max_download_rate \'0\' --max_upload_rate \'0\' --max_uploads \'4\' --minport \'49160\' --maxport \'49300\' --rerequest_interval \'1800\' --super_seeder \'0\' > /dev/null');
for($x=0;$x<10;$x++) {
sleep(30);
set_time_limit(45);
}
?>

Falcon4
05-21-2007, 06:43 PM
You don't put that anywhere. It is a file itself. Did you notice that line contains a path to one of my torrents on my server? It was just a hackish example of a way I tried to run a torrent.

It's not a fix.

aceofspades
05-21-2007, 07:01 PM
b4rt 2.1 is working great. I can now start multiple torrents at once which is simply INVALULABLE.

For an american my english really does suck!!!

aceofspades
05-22-2007, 09:33 AM
i successfully installed b4rt-2.1 and im downloading even faster and dying less. I havent had my torrents die in days.

TORRENT FLUX FTW!!!

lokhor
10-07-2008, 05:16 PM
Is it against the TOS to use this?

Evil_Dictator
10-07-2008, 06:36 PM
You've brought to life a very old thread. We will disable any accounts that try to run torrents. Torrent tracking is not suited for a shared environment.