View Single Post
Old 09-10-10, 21:57
pirpiliter's Avatar
pirpiliter pirpiliter is offline
Senior Member
Join Date: Sep 2008
Posts: 27
Default How to install Gazelle RC2 on Debian or Ubuntu
This guide is designed for Debian based systems (Ubuntu for example). This tutorial is going to assume you are installing it under a vhost in /var/www.

Before we get to Gazelle:

1. Update software, and package cache:

sudo aptitude update && sudo aptitude upgrade
2. Build essentials (install important stuff):

sudo aptitude install build-essential gcc wget subversion automake libtool make g++ -f mysql-server mysql-client libmysqlclient15-dev libboost-date-time-dev libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev zlib1g-dev libpng-dev libmcrypt-dev libxml2-dev libevent-dev libmysqld-dev
apache2, php5, memcached, and sphinxsearch are also in the Debian package repository so you don't need to build by hand. If you run Sid (unstable) you will get the versions described below.

sudo apt-get install apache2 php5 memcached sphinxsearch
3. Install Apache HTTP Server:

cd /usr/local && wget

tar -xzvf httpd-2.2.16.tar.gz && cd httpd-2.2.16

./configure --enable-so


make install

/usr/local/apache2/bin/apachectl start

/usr/local/apache2/bin/apachectl stop
4. Install Memcached (you can also use this shell script to install memcache automatically)

cd /usr/local && wget

tar -xvf memcached-1.4.5.tar.gz && cd memcached-1.4.5



make install
5. Install PHP

cd /usr/local && wget

tar xzvf php-5.3.3.tar.gz && cd php-5.3.3

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mcrypt --with-mysqli --with-gd --enable-mbstring


make install

libtool --finish /usr/local/php-5.3.3/libs

cp php.ini-development /usr/local/lib/php.ini

cd /usr/local/src/ && wget

tar xzvf memcache-2.2.4.tgz && cd memcache-2.2.4

phpize && ./configure --enable-memcache && make

mkdir -p /usr/local/lib/php/extensions/no-debug-non-zts-20090626

cp modules/ /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
Add to your php.ini (/usr/local/lib/php.ini) file and restart the webserver (/usr/local/apache2/bin/apachectl restart)

While in php.ini - find the line: "short_open_tag = Off" - Turn it On, and restart apache

6. Locate HTTPD.conf
Should be in /usr/local/apache2/conf
add the following lines to the the bottom of the .conf file:

LoadModule php5_module modules/
<FilesMatch \.php$>
SetHandler application/x-httpd-php
<FilesMatch "\.ph(p[2-6]?|tml)$">
SetHandler application/x-httpd-php
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
you can add this as well, so you can set where your files are served from:

<VirtualHost *:80>
DocumentRoot /var/www
<Directory "/var/www">
AllowOverride All
allow from all
Options +Indexes
Test it:

/usr/local/apache2/bin/apachectl start
Create a PHP file with the folowing code in it:
<?php phpinfo(); ?>
Place that file in your web root (in this case, /var/www) and navigate to localhost (either, or - See if you have success!

7. Start Memcache (if you used the shell script from step 4, skip this step as memcache is already running!)

memcached -d -m XXX -s /var/run/memcached.sock -a 0777 -t16 -C -u root
xxx= megabytes of ram. We used 512 for the -m XXX bit.

8. Run an SQL query for gazelle.sql to create the database, the table, and the default data. To use the code below you must first extract gazelle.sql (from the latest release) to /var/www/

mysql -u root -p < /var/www/gazelle.sql
9. Install Sphinx
-for documentation, see:

Sphinx is a bit tricky. You have been warned.

Run this:

cd /usr/local && wget

tar xzvf sphinx-1.10-beta.tar.gz && cd sphinx-1.10-beta



make install
Use the sphinx.conf included in the latest Gazelle tarball build

Put sphinx.conf in /usr/local/sphinx-1.10-beta as sphinx.conf. You will need to edit in your database settings, otherwise nothing will work. (Really important ones are lines 11, 99, 312-315)

Run the following commands:

mkdir -p /var/data/sphinx/delta

/usr/local/bin/indexer -c /usr/local/sphinx-1.10-beta/sphinx.conf --all

mkdir -p /var/log/searchd/

If you get any errors, try to debug it yourself. If all else fails, post in the forums or join IRC.

10. Front-end Install

1. Get the latest copy of Gazelle from Once you have downloaded and extracted it, upload it to your server.

2. Run the following command:

cp /var/www/classes/config.template /var/www/classes/config.php
3. With FileZilla or a shell editor, open config.php. This is your main configuration file for Gazelle. Set all the settings for your site, how you want them. The important bit is the SITE_SALT and other hashes. You can use this site to make good hash keys:

P.S. if you get a MYSQL SOCK error, change the line about that in the config file to /var/run/mysqld/mysqld.sock

4. Register at your site, you will be made a SysOp automatically. You will not be sent an email, just login. You'll need to configure the email server later.

5. Setup cron jobs:

Use the following commands:

crontab -e
Enter this:

0,15,30,45 * * * * /usr/local/bin/php /var/www/schedule.php INSERT_YOUR_SCHEDULE_KEY >> /root/schedule.log

10,25,40,55 * * * * /usr/local/bin/php /var/www/peerupdate.php INSERT_YOUR_SCHEDULE_KEY >> /root/peerupdate.log

* * * * * /usr/local/bin/indexer -c /usr/local/sphinx-1.10-beta/sphinx.conf --rotate delta requests_delta

5 0,12 * * * /usr/local/bin/indexer -c /usr/local/sphinx-1.10-beta/sphinx.conf --rotate --all
Where SCHEDULE_KEY is the password you set in classes/config.php

11. Back-end install (XBTT)

***This probably wont work, I have a version which I will test again that should work on Debian***

cd /var/www/ && tar xzvf xbtt.tar.gz && cd xbtt/build/xbtt/

./configure --bindir=/path/to/xbtt/xbtt/bin --libdir=/path/to/xbtt/xbtt/lib --libexecdir=/path/to/xbtt/xbtt/lib --enable-epoll


sudo make all install
For common installation problems, see here:
don't ask me to set up your tracker please
Reply With Quote