# Bittorrent Tracker Help Needed

## Bob P

I am interested in setting-up a private bittorrent tracker for an open-source software project.  Unfortunately, I don't know squat about bittorrent, so I need to ask for advice.

I'd like to set-up a private tracker, so that the project can provide its own tracker.  FWICT the best way to do this is to use a php-capable http program such as Apache2 along with bittorrent.  I've scoured the web for information on how to set-up a tracker, and the most relevant information that I've found to date for running Bittorrent on Gentoo has been the Gentoo-Wiki article How To Set-Up a Bittorrent Tracker.

Unfortunately, this HowTo assumes that I already know how to use both Apache2 and php.  Although I do have some familiarity with Apache2, I have zero experience with PHP.  In other words, I am  total php-ignoramus.   :Embarassed:   Everything in the Wiki article seems straightforward enough... that is... until I get to the line that says "you need a webserver with php."

So I have a number of questions:

1.  Do I have to use Apache2, or can php be supported by packages such as vsftpd or thttpd?

2.  If I need Apache2, then can anyone recommend a good straightforward Apache2 + php HowTo?

3.  How much CPU power is actually required to run a Bittorrent Tracker?  Optimally, I'd like to dedicate an older PC to perform this task as a dedicated webserver, and I'd like to dedicate as little processing power as possible to this role.

4.  How do different bittorrent trackers compare?  I have read that this can be done via Gnome/Azureus/Java, but that such a deployment requires a gigahertz-class box.  Obviously, I don't feel a pressing need to run a GUI-based webserver/tracker, so I'd prefer an installation that doesn't even require X.  For a non-X type of installation, how much processor is really needed?

TIA!

bob

Removed URL to the no longer existing unofficial wiki turned into spam. (2019-06-11) —Chiitoo

----------

## xbmodder

i reccomend using bttrack. bttrack comes with bittorrent. 

```

emerge bittorrent

```

edit your /etc/conf.d/bttrack

this is mine:

```

# /etc/conf.d/bttrack

# Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/net-p2p/bittorrent/files/bttrack.conf,v 1.1 2004/07/17 15:04:15 squinky86 Exp $

# Change this to this to the port you would like to connect to for the tracker.

# It is accessible at http://localhost:PORT/ from any web browser.

PORT=8082

# where to store recent downloader info

DFILE=/usr/share/bittorrent/tracker.dfile

# path to favicon.ico which many popular web browsers can use

FAVICON=/usr/share/bittorrent/favicon.ico

# Connection logs are sent to stdout by default, so they should be sent to a

# file when using this script.

LOGFILE=/var/log/bttrack.log

```

```

rc-update add bttrack default

/etc/init.d/bttrack start

```

The only settings you need to change is port. Set the port to something you know that won't be in use. You might want to change your favicon too. To make torrents go:

```

btmakemetafile.py (THE FILE) (ANNOUNCE URL)

```

replace (THE FILE) with the path to the file

replace the ANNOUNCE URL with http://(external host):(PORT)/announce

external host means what IP/HOST is on the inet.

Port is the one you set in /etc/conf.d/bttrack

----------

## Bob P

you've got to be kidding.  it can't be that easy, can it?  why does the Gentoo Wiki article mention using bttrack, but state that you need to configure a php webserver with TorrentTrader?

----------

## Bob P

hmmm.  bittorrent pulls in 22 dependencies, including Xorg and gtk+.   :Mad: 

is there an easy way to do this without having to install Xorg?  the box that i'd like to use is a dedicated server, and i just can't see putting xorg on it.  i was hoping to do everything from the console.

----------

## bigfunkymo

add this line to /etc/portage/packages.use:

```
net-p2p/bittorrent -X
```

If you still have other pesky dependancies, you can try adding adding the appropriate negative use settings

----------

## Bob P

thanks.  i am familiar with portage, but not with bittorrent.  will that approach that prevents the dependencies from being emerged  result in any impairment of the bittorrent application?

----------

## Chris W

No, it will just not build the GUI components of the BitTorrent client.

----------

## bigfunkymo

what he said.

I spent an exorbitant number of hours trying to make a php-based torrent tracker work for me the other night because I didn't see any way to control which torrents could use my tracker while using the "official" bit torrent software.  What I wound up doing was running a tracker using my home PC and azureus and then having my server machine download the torrent and begin to seed as well.  I figured with the current state of tracking software, Azureus was probably just as stable and secure as any other tracker.

----------

## Bob P

 *xbmodder wrote:*   

> 
> 
> The only settings you need to change is port. Set the port to something you know that won't be in use. You might want to change your favicon too. To make torrents go:
> 
> ```
> ...

 

just a couple of questions aobut this:  

1.  regarding (THE FILE)

as i understand you, (THE FILE) is the path to the directory that contains both the .torrent file AND the file that gets downloaded, right? 

or is it the fully qualified path name to the torrent file itself?  if its the full path to the .torrent file, then i'm assuming that i have to put both the file to be transferred and the .torrent file in the same subdirectory.

2.  regarding the tracker:

will the btmakefile.py script solely perform tracking operations, or will it both seed and track?

never having run a tracker before, i'm just trying to get a feel for how this is supposed to work.

thanks!

----------

## bigfunkymo

The tracker is just that, it tracks.  It is what clients connect to in order to get information about other clients.  The seeding is actually done 100% by the clients.  Generally speaking, it works like this: 

You run a tracker

You make a torrent file from your data, the torrent references the tracker

You open the torrent file with your client, since you already have the data, you're automatically a seeder

Just wait for other connections from people with your torrent file

----------

## Bob P

Still having problems.  I've used the exact same /etc/conf.d/bttrack file contents as mentioned by @xbmodder.  i've started the bittorrent daemon and added it to the default runlevel.  and i've started up the torrents using the python scripts.

when i attempt to download the torrent file from another PC that is located on my LAN running a bittorrent client, I'm getting the following error:

```
Problem connecting to tracker - <urlopen error(7, 'getaddrinfo failed')>
```

this error code supposedly is issued when a bittorrent tracker is overloaded.  i guess it should also occur when a bittorrent tracker just isn't working, as is the case in my situation.

just for reference, i'm still operating without an answer to my previous question about command line syntax for the python script.  i still don't know whether or not (THE FILE) refers to:

1) only the path to the directory where the file is held,

2) the fully qualified path to the .torrent file (including its filename)

3) the fully qualified path to the .tar.bz2 file (including its filename)

i have tried initializing the python script all three ways, namely:

```

btmakemetafile.py /path/to/file/ http://my.domain.homelinux.org:8082/announce

btmakemetafile.py /path/to/file/filename.torrent http://my.domain.homelinux.org:8082/announce

btmakemetafile.py /path/to/file/filename.tar.bz2 http://my.domain.homelinux.org:8082/announce

```

i'm thinking that by using all 3 approaches i should have the bases covered -- but it seems that my bittorrent client cannot download the file from the tracker.

just for reference, the /path/to/file on my system contains both the .torrent file and the .tar.bz2 file in the same directory.

any ideas would be greatly appreciated.  thanks!

----------

## kiksen

btmakemetafile.py is creating the torrent file, so it should not be given any option pointing to one.

the <file> is the full path to the file you want to build a .torrent file for. You can list several files of cause.

Example:

If you have your tracker running on http://mydomain:7000

and you want to share /var/bittorrent/shares/mycoolproject.tar.bz2

you should issue the command as follows:

btmakemetafile.py http://mydomain:7000 /var/bittorrent/shares/mycoolproject.tar.bz2

which will build your torrent file.

Put the torrent file on your web server and see if it works  :Smile: 

/kiksen

----------

## Bob P

 *kiksen wrote:*   

> btmakemetafile.py is creating the torrent file, so it should not be given any option pointing to one.
> 
> the <file> is the full path to the file you want to build a .torrent file for. You can list several files of cause.
> 
> 

 

ok.  somehow i missed that.  am i correct in understanding that the python script ONLY creates the torrent file, and that bttrack actually does the bittorrent tracking?

by using the torrent file that's generated by the python script, the previously cited error disappears.  it turns out that i had a port misconfigured.

 *Quote:*   

> If you have your tracker running on http://mydomain:7000
> 
> and you want to share /var/bittorrent/shares/mycoolproject.tar.bz2
> 
> you should issue the command as follows:
> ...

 

thanks.  i think that as i understand the previous message, did you make a typo and change the order of the last two parameters?

```
btmakemetafile.py  /var/bittorrent/shares/mycoolproject.tar.bz2 http://mydomain:7000
```

 *Quote:*   

> Put the torrent file on your web server and see if it works 

 

i've put both the torrent file and the tarball on the webserver.  when i download the torrent file, bittorrent automatically starts up and attempts to download the file.  unfortunately, no data is ever transferred and the bittorrent log remains blank. 

running netstat -an on the server shows that a connection is established, but then changes to a time_wait status and then eventually disappears.  :Confused: 

it seems that there's still a piece missing to the puzzle.   :Confused: 

----------

## kiksen

I'm pretty sure I didn't make a type. But I just switched from BitTornado to BitTorrent 4.0.2 and the command is called maketorrent.py. BUT, it's till maketorrent.py URL file [file] so it's not a typo.

And your assumption is right. The command only builds the .torrent file. bttrack.py does the tracking. You have to start the tracker (edit /etc/conf.d/bttrack and 'rc-update add bttrack default' as mentioned by xbmodder).

To start the tracker before your next reboot, run /etc/init.d/bttrack start.

/kiksen

edit: you also have to seed the torrent... that might be your problem. try running btlaunchmanycurses.py --ip <ip of your server> . in the directory where the torrent exists. It will check the file and start seeding... then your tracker will work - I just made a setup on my home lan to check  :Smile: 

----------

## Bob P

 *kiksen wrote:*   

> edit: you also have to seed the torrent... that might be your problem. try running btlaunchmanycurses.py --ip <ip of your server> . in the directory where the torrent exists. It will check the file and start seeding... then your tracker will work - I just made a setup on my home lan to check 

 

is the value <ip of your server> the IP address on the internet, or the RFC 1918 address on the LAN?

so far i've been able to get btloadmanycurses.py to initialize, in which it scans and apperars to "upload" the local file into the tracker.  i'm still having no luck getting my windows based bittorrent client to connect, though.  i feel like i've gotten a step closer but it seems that i'm still missing something.   :Confused: 

----------

## kiksen

My guess would be the public IP of the server. What really matters is that your tracker can inform other machines on the internet that there's a seeder available.

If your windows box is on you LAN, you might need to configure it with --ip too (there's an option en the bittorrent GUI for that under view->settings->network).

/kiksen

----------

