(Answer) (Category) Brian's BitTorrent FAQ and Guide : (Category) Advanced Topics : (Category) How do I run a tracker? : (Answer) Using the standard Python tracker

Here are the general steps you should follow to use the standard ("reference") Python tracker from Bram Cohen.

  1. Install Python if you don't already have it on your system. Windows users should follow this link to download the Python 2.2.3 installer from python.org. If you use Linux (or BSD, OS X) you will want to consult your distribution's package management system. There are some details on this at (Xref) Linux/Unix .
  2. Get the Python source code of BitTorrent. Note: A lot of changes have been made to the source since 3.2.1 was released, I strongly recommend that you get the latest sources from CVS if you want to run the tracker. To check out the source from CVS, issue the following command, assuming that you have a CVS client installed:

    cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/bittorrent co BitTorrent

    This will create a BitTorrent directory under the current working directory. Note: Sourceforge's CVS server has been very flaky recently, presumably due to overload. If you find that you cannot get the above command to work, i.e. you get "Connection reset by peer" or some sort of timeout error, you can try this alternative server:

    cvs -d:pserver:anonymous@cvs-pserver.sourceforge.net:80/cvsroot/bittorrent co BitTorrent

    If you need help installing a CVS client on your system, consult the Sourceforge documentation for Windows users here as well as the general CVS documentation here. Note that you can also access the sources through WebCVS.
  3. Page through the README.txt file for general instructions on how the tracker works. Essentially, you change to the directory that contains the bttrack.py file and issue a command such as:

    python bttrack.py --port 6969 --dfile dstate --logfile tracker.log

    Note that if this command is successful you won't see anything on the screen at all -- the tracker will remain open until you kill it, so you may want to put the command in a batch file for easy startup. To check your tracker's operation, connect to the machine running the tracker, i.e. by loading "http://machine-name:6969/" into your browser. If successfull you should see a status page in your browser.

    Your tracker's announce URL will be "http://machine-name:6969/announce". This is what should be entered in the appropriate field when creating a .torrent for your tracker.

  4. You should review the command line parameters and make any changes as appropriate. Note that the "--logfile" parameter is new in CVS and not present in 3.2.1. If you must use the 3.2.1 sources, you will want to redirect the log messages on stdout to a file, e.g. by appending ">> tracker.log" to your command line. You can also run "python bttrack.py to get a list of command line parameters. Some parameters that might be of interest are:

    --nat_check n
    If 1 (default), don't allow users behind NAT gateways use the tracker. You probably want to set this to 0 for a general-access site.
    --allowed_dir dir
    Use this to restrict the files which your tracker will track. This parameter specifies a directory name, and it will only track torrents that exist in this directory. If this parameter is present you must somehow place the .torrent file in the specified directory before the tracker will accept it.
    --show_names n
    If set to 1, the tracker will show filenames of torrents that it knows about in its allowed_dir, instead of just showing info_hash's on its status page.
    See (Xref) What are the command line parameters of the BitTorrent Python tracker? for a complete list of command line parameters.

[Append to This Answer]
Next: (Answer) Using BNBT
This document is: http://btfaq.com/cgi-bin/fom?file=58
[Search] [Appearance]
This is a Faq-O-Matic 2.721.