Setup Gazelle Torrent Tracker

From banana_wiki
Revision as of 15:49, 10 April 2014 by Bananafish (talk | contribs) (Created page with "This tutorial was tested on Ubuntu 12.04 x86_64 on an Amazon EC2 instance. The date tested was 11/06/2012. Thanks to gazelle team and SSMinnow for providing the project and th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This tutorial was tested on Ubuntu 12.04 x86_64 on an Amazon EC2 instance. The date tested was 11/06/2012. Thanks to gazelle team and SSMinnow for providing the project and the other tutorials. the tutorials on the gazelle site are a little dated and not functioning.

First we will install the software and dependencies we need:

sudo apt-get install build-essential gcc wget subversion automake libtool make g++ -f mysql-server 
mysql-client libmysqlclient15-dev zlib1g-dev libpng-dev libmcrypt-dev libxml2-dev libevent-dev 
libmysqld-dev apache2 php5 php-soap php-pear memcached sphinxsearch gcc 
build-essential binutils libmysql++-dev g++ libev-dev php5-memcache php5-curl git

If you want to be able to manipulate your MySQL databases via webGUI install:

sudo apt-get install phpmyadmin

Next we need to install some dependencies for ocelot. The old tutorial uses old versions of libboost and has you manually install them, on a current system this could break apt and isn’t desirable.

So we are going to install:

sudo apt-get install libboost1.46-all-dev

Now we are going to download gazelle to our home directory:

git clone git://git.what.cd/gazelle
sudo cp -r gazelle/* /var/www

Next we need to import the starter database for gazelle into MySQL, this will ask you for the password you entered earlier when you installed MySQL. Note: this can also be imported via phpmyadmin.

mysql -u root -p < /var/www/gazelle.sql

Now we need to edit the site configuration file for gazelle:

sudo cp /var/www/classes/config.template /var/www/classes/config.php
sudo nano /var/www/classes/config.php

note: You must fill in everything minus IRC otherwise you will get a blank white page error.

Change /var/run/mysqld/mysql.sock to /var/run/mysqld/mysqld.sock Change your site details and ports and fill in the encryption keys.

Now its time to get Ocelot:

sudo mkdir /ocelot
cd /ocelot
wget http://what.cd/ocelot-0.5.1.tar.bz2
tar -xvf ocelot*
sudo cp src/* /ocelot
sudo cp config.cpp.template config.cpp
sudo nano config.cpp

note: edit your MySQL details accordingly in config.cpp and change the port to 2710 if you left it as the default in config.php

Now to compile and install Ocelot, for some reason mysql-lib isn’t where it is expected to be so that is why there are extra options with configure:

sudo ./configure --with-mysql-lib=/usr/lib/x86_64-linux-gnu/
sudo make
sudo make install

Now we need to configure sphinx for searching:

sudo cp /var/www/sphinx.conf /var/www/sphinx.conf.bak
sudo nano /var/www/sphinx.conf
sudo cp /var/www/sphinx.conf /etc/sphinxsearch/
sudo mkdir -p /var/data/sphinx/delta
sudo mkdir -p /var/log/searchd
sudo indexer -c /etc/sphinxsearch/sphinx.conf --all

note make sure you update the MySQL details in sphinx.conf and change /var/run/mysqld/mysql.sock to /var/run/mysqld/mysqld.sock

Now let’s create the cronjob for the processes needed by gazelle, I have updated this to reflect the proper paths for ubuntu and the software from apt:

sudo crontab -e

and paste in:

0,15,30,45 * * * * php /var/www/schedule.php KEY >> /home/ubuntu/schedule.log
10,25,40,55 * * * * php /var/www/peerupdate.php KEY >> /home/ubuntu/peerupdate.log

* * * * * indexer -c /etc/sphinxsearch/sphinx.conf --rotate delta requests_delta

5 0,12 * * * indexer -c /etc/sphinxsearch/sphinx.conf --rotate --alls

note make sure you change KEY to the schedule key you used in config.php

Lastly, we will make a bash script to start the things we need and we won’t have to specify each manually, I have also modified this to reflect the proper changes:

nano gaz_start.sh

and paste in:

#!/bin/bash
memcached -d -m 512 -s /var/run/memcached.sock -a 0777 -t16 -C -u ubuntu
searchd
ocelot

Press Ctrl+X and select Yes.

now make the script executable:

sudo chmod +x gaz_start.sh

Now when you restart and want to start up your programs, type in this :

sudo ./gaz_start.sh

note you may want to start the script in a screen so that you don’t have to leave the session open

Congrats, you have a basic gazelle setup installed and working.