注,文章转载自:http://www.visigod.com/xbt-tracker/installation
稍加修改!
The XBT tracker (XBTT) can run on Unix/Linux or Windows. Please check the tutorial that fits you best.
Using Unix/Linux
The XBTT must be compiled from source on Unix/Linux. You need shell and root access to compile and run XBTT. You also need the following packages:
- boost-devel
- mysql-devel、mysql-server (这里要加上server,否则后面数据库连接会出问题)
- gcc-c++
- subversion
To install this required packages you can run the following commands in your server:
Installing the required packages on Debian |
1 2 3
| apt-get install cmake g++ libboost-date-time-dev libboost-dev \ libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev \ libboost-serialization-dev libmysqlclient15-dev make subversion zlib1g-dev |
Installing the required packages on CentOS, Fedora or Red Hat |
1
| yum install boost-devel gcc-c++ mysql-devel subversion |
If for some reason the boost libraries are still on the old version, you can do the following:
Install Boost manually |
1
2
3
4
5
6 |
- cd /usr/local/src/
- wget http:
- tar xvzf boost_1_44_0.tar.gz
- cd boost_1_44_0
- ./bootstrap.sh
- ./bjam install
|
Then create a folder in your server and type the following:
1 2 3 4
| svn co https://xbtt.svn.sourceforge.net/svnroot/xbtt/trunk/xbt/misc xbt/misc svn co https://xbtt.svn.sourceforge.net/svnroot/xbtt/trunk/xbt/Tracker xbt/Tracker cd xbt/Tracker ./make.sh |
After the server is compiled you will have a xbt_tracker binary under xbt/Tracker. Copy this binary into the directory where you will run XBTT along with the xbt_tracker.conf.default that is on the same folder. You will end up with two files in your xbt directory: the xbt_tracker and the xbt_tracker.conf.default. Rename the xbt_tracker.conf.default to xbt_tracker.conf.
we are using /home/xbt_tracker as an example |
1 2 3 4 5
| cp xbt_tracker /home/xbt_tracker/ cp xbt_tracker.conf.default /home/xbt_tracker/ cp xbt_tracker.sql /home/xbt_tracker/ cd /home/xbt_tracker/ mv xbt_tracker.conf.default xbt_tracker.conf |
We now need to create a database to be used with XBTT. You can use phpMyAdmin of the mysql command to create it. See the example below using the mysql client:
这里我没有装phpMyAdmin,所以直接从命令行执行!
在执行之前,还先要启动mysqld服务,设置口令等等!
- /etc/init.d/mysqld start
- mysqladmin -u root password *****
- mysql -u root -p
- 输入口令
然后将用户加入数据库:
CREATE USER 'xbt_tracker'@'localhost' IDENTIFIED BY 'my_tracker_password';
GRANT USAGE ON * . * TO 'xbt_tracker'@'localhost' IDENTIFIED BY 'my_tracker_password';
CREATE DATABASE IF NOT EXISTS `xbt_tracker` ;
GRANT ALL PRIVILEGES ON `xbt_tracker` . * TO 'xbt_tracker'@'localhost';
After the database is created we need to import the default sql that we previously copied into our xbt_tracker home directory. Just type the following command in the shell of your server:
1
| mysql -uxbt_tracker -pmy_tracker_password xbt_tracker < xbt_tracker.sql |
Ok, the default database schema (xbt_tracker.sql) is imported into the database we have created. All that is left is to configure XBTT to use it. To do so, edit the xbt_tracker.conf in the xbt_tracker home directory and use the following (change the values to fit you need. We are going to use the ones from the previous commands):
1 2 3 4
| mysql_host = localhost mysql_user = xbt_tracker mysql_password = my_tracker_password mysql_database = xbt_tracker |
然后,进入mysql
use xbt_tracker
将如下信息导入.
insert into xbt_config values ('announce_interval', '1800');
insert into xbt_config values ('anonymous_connect', '1');
insert into xbt_config values ('anonymous_announce', '1');
insert into xbt_config values ('anonymous_scrape', '1');
insert into xbt_config values ('auto_register', '1');
insert into xbt_config values ('clean_up_interval', '60');
insert into xbt_config values ('daemon', '1');
insert into xbt_config values ('debug', '0');
insert into xbt_config values ('gzip_announce', '1');
insert into xbt_config values ('gzip_debug', '1');
insert into xbt_config values ('gzip_scrape', '1');
insert into xbt_config values ('listen_check', '0');
insert into xbt_config values ('listen_ipa', '*');
insert into xbt_config values ('listen_port', '2710');
insert into xbt_config values ('log_access', '0');
insert into xbt_config values ('log_announce', '0');
insert into xbt_config values ('log_scrape', '0');
insert into xbt_config values ('pid_file', 'xbt_tracker.pid');
insert into xbt_config values ('read_config_interval', '300');
insert into xbt_config values ('read_db_interval', '60');
insert into xbt_config values ('redirect_url', '');
insert into xbt_config values ('scrape_interval', '0');
insert into xbt_config values ('table_announce_log', 'xbt_announce_log');
insert into xbt_config values ('table_files', 'xbt_files');
insert into xbt_config values ('table_files_updates', 'xbt_files_updates');
insert into xbt_config values ('table_files_users', 'xbt_files_users');
insert into xbt_config values ('table_ipas', 'xbt_ipas');
insert into xbt_config values ('table_scrape_log', 'xbt_scrape_log');
insert into xbt_config values ('table_users', 'xbt_users');
insert into xbt_config values ('update_files_method', '1');
insert into xbt_config values ('write_db_interval', '60');
insert into xbt_config values ('listen_port', '2710');这项是控制端口的,我改成8080的.
insert into xbt_config values ('listen_port', '8080');
下面你会发现所有可能的配置选项,并在该xbt_config表的默认值。
xbt_config table
Below you will find all the possible configurable options and it's default values in the xbt_config table.
name: auto_register
description: If enabled it will allow torrents to auto register on the tracker.
defaut value: 0 (disabled)
name: anonymous_connect
description: If enabled it will allow anyone (anonymous) to access the tracker.
defaut value: 1 (enabled)
name: anonymous_announce
description: If enabled it will allow anyone (anonymous) to announce on the tracker.
defaut value: 1 (enabled)
name: anonymous_scrape
description: If enabled it will allow anyone (anonymous) to scrape on the tracker.
defaut value: 1 (enabled)
name: daemon
description: If enabled the server will run as a daemon (in the background).
defaut value: 1 (enabled)
name: debug
description: If enabled the server will also run in debug mode (go to http://tracker:port/debug to see debug messages).
defaut value: 0 (disabled)
name: full_scrape
description: If enabled the server will serve a full scrape to the client.
defaut value: 0 (disabled)
name: gzip_debug
description: If enabled the server will gzip (compress) the debug page.
defaut value: 1 (enabled)
name: gzip_scrape
description: If enabled the server will gzip (compress) the scrape page.
defaut value: 1 (enabled)
name: log_access
description: If enabled the server will create a file with all the accesses to the server. The file will be named (xbt_tracker_raw.log)
defaut value: 0 (disabled)
name: log_announce
description: If enabled the server will log all announces into the announce table (xbt_announce_log).
defaut value: 0 (disabled)
name: log_scrape
description: If enabled the server will log all announces into the scrape table (xbt_scrape_log).
defaut value: 0 (disabled)
name: announce_interval
description: The default announce interval (in seconds) that will be inside the torrent file.
defaut value: 1800 (30 minutes)
name: clean_up_interval
description: The default interval (in seconds) to clean the torrents that were flagged to delete.
defaut value: 60 (1 minute)
name: read_config_interval
description: The default interval (in seconds) in which the XBT binary will re-read it's configuration (from the xbt_tracker.conf file).
defaut value: 60 (1 minute)
name: read_db_interval
description: The default interval (in seconds) in which the XBT binary will re-read it's configuration (from the xbt_config table).
defaut value: 60 (1 minute)
name: scrape_interval
description: The default interval (in seconds) in which a new scrape is allowed.
defaut value: 0 (no minimum time between new scrapes)
name: write_db_interval
description: The default value (in seconds) in which the XBT binary will update his database.
defaut value: 15
name: column_files_completed
description: The default value for the 'completed' field in the xbt_files_users table.
defaut value: completed
name: column_files_fid
description: The default value for the 'fid' field in the xbt_files_users table.
defaut value: fid
name: column_files_leechers
description: The default value for the 'leechers' field in the xbt_files_users table.
defaut value: leechers
name: column_files_seeders
description: The default value for the 'seeders' field in the xbt_files_users table.
defaut value: seeders
name: column_users_uid
description: The default value for the 'uid' field in the xbt_files_users and xbt_users table.
defaut value: uid
name: offline_message
description: The offline message that will appear on the client program.
defaut value: Empty. If specifying a message the tracker will be offine.
name: pid_file
description: The file in which the tracker will store his pid (process id).
defaut value: Empty
name: query_log
description: The filename in which the XBT binary log all the queries made.
defaut value: Empty
name: redirect_url
description: The URL to where the client is redirected if he/she tries to access the tracker URL via a normal browser.
defaut value:
name: table_announce_log
description: The default value for the announce_log table
defaut value: xbt_table_prefix (in xbt_tracker.conf) + announce_log
name: table_deny_from_hosts
description: The default value for the deny_from_hosts table.
defaut value: xbt_table_prefix (in xbt_tracker.conf) + deny_from_hosts
name: table_files
description: The default value for the files table.
defaut value: xbt_table_prefix (in xbt_tracker.conf) + files
name: table_files_users
description: The default value for the files_users table.
defaut value: xbt_table_prefix (in xbt_tracker.conf) + files_users
name: table_scrape_log
description: The default value for the scrape_log table.
defaut value: xbt_table_prefix (in xbt_tracker.conf) + scrape_log
name: table_users
description: The default value for the users table.
defaut value: xbt_table_prefix (in xbt_tracker.conf) + users
name: torrent_pass_private_key
description: The default torrent pass private key.
defaut value: A 27 character random string
name: listen_ipa
description: The IP address for the XBT Tracker.
defaut value: Empty. It will run on all available IP's.
name: listen_port
description: The port in which XBT Tracker will run.
defaut value: 2710 (TCP and UDP)
We have now concluded the installation of XBTT on our server. So let's start it. To do it just type:
You now have XBTT running on the default port 2710. To customize it please read the
XBTT Configuration
page. To see how you can always start XBTT when your server starts please check the
General Tips
page.
Using Windows
To use the tracker on Windows you can download the installation file from the XBT project page. After downloading the exe file you must run it to install it on your computer. The windows version is installed by default as a service.
Personal note: Although XBTT runs on Windows I recommend you to run it on a linux server.