View Single Post
  #38  
Old 9th October 2010, 21:57
pirpiliter pirpiliter is offline
Senior Member
 
Join Date: Sep 2008
Moldova
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:

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

Code:
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.

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

Code:
cd /usr/local && wget http://mirror.cc.columbia.edu/pub/software/apache//httpd/httpd-2.2.16.tar.gz

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

./configure --enable-so

make

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)

Code:
cd /usr/local && wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz

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

./configure

make

make install
5. Install PHP

Code:
cd /usr/local && wget http://us3.php.net/get/php-5.3.3.tar.gz/from/this/mirror

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

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 http://pecl.php.net/get/memcache-2.2.4.tgz

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/memcache.so /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
Add extension=memcache.so 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:

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

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

Code:
/usr/local/apache2/bin/apachectl start
Create a PHP file with the folowing code in it:
Code:
<?php phpinfo(); ?>
Place that file in your web root (in this case, /var/www) and navigate to localhost (either 127.0.0.1, or 127.0.1.1) - 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!)

Code:
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/

Code:
mysql -u root -p < /var/www/gazelle.sql
9. Install Sphinx
-for documentation, see: http://www.sphinxsearch.com/docs/current.html

Sphinx is a bit tricky. You have been warned.

Run this:

Code:
cd /usr/local && wget http://sphinxsearch.com/downloads/sphinx-1.10-beta.tar.gz

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

./configure

make

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:

Code:
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/

/usr/local/bin/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 http://what.cd/gazelle. Once you have downloaded and extracted it, upload it to your server.

2. Run the following command:

Code:
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: http://grc.com/passwords.html

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:

Code:
crontab -e
Enter this:

Code:
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***

Code:
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

make

sudo make all install
For common installation problems, see here: http://what.cd/gazelle/forums.php?ac...ead&threadid=2
----------------------------------
source: http://what.cd/gazelle/
__________________
don't ask me to set up your tracker please
Reply With Quote