We raise our own torrent tracker on Centos
We raise our own torrent tracker on Centos
Why you need your own torrent tracker is not a question. The reasons may be different. So I'll get straight to the point.
Probably, all major trackers are written to order, or well-known engines are individually "finished". When the goal is to raise your own, for example, a local tracker, most often the requirements for it will not be very high, and it remains to choose the desired option from all available, with the prospect of development.
I thought something like this, considering and evaluating each candidate. I stopped my choice on TorrentPier II . Assessing the pros and cons, it should be noted that the user interface is familiar to users, similar to the notorious Rutracker, and technical support, albeit in the form of a forum . The tracker, after a little setup, has been working for me for more than a year without any problems.
The installation looks like this (a small quote from the instructions):
1. Unpack the contents of the folder you downloaded to the server
2. Create a database into which, using phpmyadmin (or any other convenient tool), we import the dump located in the **install/sql/mysql.sql** folder
3. Edit the configuration file **library/config.php** uploaded to the server:
> ***'db1' => array('localhost', 'dbase', 'user', 'pass', $charset, $pconnect)***
In this line, we change the login data to the database
***$domain_name = 'torrentpier.me';***
This line contains your domain name. Other edits to the file are optional.
I must say that the tracker does not want to work on PHP 7.0. I had to create a separate container for it with PHP 5.4.45. Recommended PHP version: 5.3 - 5.5. In addition, the authors recommend in some cases to untie the built-in cron engine (required for work), and use a regular server one. The task might look like this:
*/5 * * * * /usr/bin/php -f /var/www/site.ru/htdocs/cron/cron.php
With the installation of the tracker, everything is clear enough, but there is something else that needs to be done. In my case, a torrent tracker is a help for the site, and it acts as an alternative for a user who is used to downloading files from sites using torrents. In general, the initial source of distribution, roughly speaking, is always myself. Therefore, it is necessary to prepare a “full set”: a torrent tracker filled with torrent files (which can then be beautifully placed on the site), and plus a distribution source. I decided that the torrent client, that is, the distribution source itself, will be located on the same server as the site and the torrent tracker. We need a client with Web ui under Centos.
My choice fell on Deluge . The installation looks like this:
- Adding a repository
vi /etc/yum.repos.d/deluge.repo
[deluge]
name=LinuxTECH - deluge
baseurl=http://pkgrepo.linuxtech.net/el6/release/
enabled=1
gpgcheck=1
gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET
includepkgs=deluge* GeoIP python-chardet rb_libtorrent*
— Installation:
yum -y install deluge deluge-common deluge-web deluge-console deluge-images deluge-daemon
- Adding a user:
useradd --system --home /var/lib/deluge deluge
- According to the recommendation from the Deluge forum, in the case of using Centos, you need to correct the config:
vi /etc/init.d/deluge-daemon
We change the line:
prog2=deluge
on:
prog2=deluge-web
and
daemon --user deluge "$prog2 --ui web >/dev/null 2>&1 &"
change to:
daemon --user deluge "$prog2 >/dev/null 2>&1 &"
- Add to autoload:
chkconfig deluge-daemon on
- Open port 8112, necessary for the web interface to work:
vi /etc/sysconfig/iptables
-A INPUT -p tcp -m conntrack --ctstate NEW -m multiport --dports 8112 -j ACCEPT
service iptables restart
— Launch:
service deluge-daemon start
Open the Deluge interface (http://ip_server:8112), the default password is "deluge".
It remains to create the actual torrent files, place them in the tracker, and create an upload/download in the client.
To create torrents, you can use your "home" torrent client. But you can also use the previously installed Deluge. You cannot create torrent files from the Deluge web interface, here you can use the console or connect to Deluge from your PC. For example, there are corresponding clients for Windows users .
After installing Deluge on a PC, in the settings, in the “Interface” section, uncheck the “classic” checkbox and create a connection to a remote server using the data prepared for this:
- On the server, register accesses:
echo "user:pass:10" >> /var/lib/deluge/.config/deluge/auth
- Open the appropriate ports, at least port 58846, plus those needed for distribution. In my case, “the (distribution) process started” after opening ports 6881:6889, as well as 53567 (tcp / udp).
Do not forget to use the Deluge web client in the parameters to set the desired port (if the default one changes), and allow remote connections.
Now everything is ready. So, once again - the simplest option for preparing a "full set" is as follows:
- Install and configure the torrent tracker TorrentPier II on the server;
- Install and configure the Deluge torrent client on the server;
- A file is uploaded to the server, which will be distributed;
- A new torrent file is created on the "home" torrent client;
- The torrent file is uploaded to the tracker that this file modifies;
- Now, using this modified torrent file, we create a distribution on the Deluge torrent client located on the server, and as the download directory, specify the one where the previously downloaded file for distribution lies.
The tracker is in operation, and the distribution is always spinning on the server, which means that your users will always find at least one seed.
Comments
Post a Comment