CentOS6.x用xbt_tracker建立自己的tracker服务器

昨天在由于极影抽风,只好把资源发在动漫花园,但是极影的tracker以及备用tracker都无法使用,最后又到nyaa发了个种,才让种子活过来;为了避免”历史总是惊人的相似”的情况….就自己建了个tracker

http://tracker.kuroy.me:5944/announce
https://tracker.kuroy.me/announce #改用chihaya搭建

安装依赖环境

yum install boost-devel gcc-c++ mysql-devel subversion

获取xbt_tracker源码

cd /home
svn co https://svn.code.sf.net/p/xbtt/code/trunk/xbt/misc xbt/misc
svn co https://svn.code.sf.net/p/xbtt/code/trunk/xbt/Tracker xbt/Tracker
cd xbt/Tracker
./make.sh

如果出现command not found使用yum install svn -y安装svn

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

建立数据库

mysql -uroot -p密码
CREATE USER 'xbt_tracker'@'localhost' IDENTIFIED BY '你的密码';
GRANT USAGE ON * . * TO 'xbt_tracker'@'localhost' IDENTIFIED BY '你的密码';
CREATE DATABASE IF NOT EXISTS `xbt_tracker` ;
GRANT ALL PRIVILEGES ON `xbt_tracker` . * TO 'xbt_tracker'@'localhost';

导入数据库&编辑conf文件

cd ../xbt/Tracker
mysql -u数据用户名 -p数据库密码 xbt_tracker < xbt_tracker.sql
cd ../xbt_tracker
vim xbt_tracker.conf

修改数据库连接设置

mysql_host = localhost  #数据库地址
mysql_user = xbt_tracker  #数据库用户名
mysql_password = qazzaq123  #数据库密码
mysql_database = xbt_tracker  数据库名

向数据库写入xbt_tracker的设置

mysql -u root -p 你的密码
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 ('full_scrape','0');
insert into xbt_config values ('gzip_debug','1');
insert into xbt_config values ('gzip_scrape','1');
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 ('offline_message','');
insert into xbt_config values ('pid_file ','xbt_tracker.pid');
insert into xbt_config values ('read_config_interval','60');
insert into xbt_config values ('read_db_interval','60');
insert into xbt_config values ('redirect_url','');
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_users','xbt_files_users');
insert into xbt_config values ('table_scrape_log','xbt_scrape_log');
insert into xbt_config values ('table_users','');
insert into xbt_config values ('write_db_interval','15');

启动xbt_tracker

./xbt_tracker

也可以用init.d启动,我就先不折腾了…