-
Notifications
You must be signed in to change notification settings - Fork 365
Gazelle installation on Ubuntu 12.04
Packages for Gazelle:
Add PPA containing PHP5
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
Install packages
sudo apt-get install mysql-server mysql-client libmysql++-dev libmysqld-dev \
libpng-dev libmcrypt-dev libxml2-dev memcached sphinxsearch binutils libev-dev git nginx \
php5-fpm php-soap php-pear php5-memcache php5-curl php5-mysql php5-mcrypt php5-gd sendmail
Packages for Ocelot
Add PPA containing newer g++ compiler
Note: Needed for C++11 features used by Ocelot.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
Install packages
sudo apt-get install make g++ g++-4.8 libbz2-dev
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
Install Boost libraries:
Note: Grab latest version from http://sourceforge.net/projects/boost/files/boost/
tar -zxf boost_VERSION.tar.gz
cd boost_VERSION
./bootstrap.sh --prefix=/usr/local
./b2 stage toolset=gcc cxxflags=-std=gnu++11 threading=multi link=shared
sudo ./b2 install toolset=gcc cxxflags=-std=gnu++11 threading=multi link=shared
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
sudo nano /etc/nginx/sites-available/default
Copy and paste the following. edit HOST_NAME:
server {
root /var/www;
index index.php;
server_name HOST_NAME;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Press Ctrl+X
and select Yes.
Restart Nginx:
sudo service nginx restart
###Configure Gazelle###
Get Gazelle:
git clone https://github.com/WhatCD/Gazelle.git
sudo mkdir /var/www
sudo cp -r Gazelle/* /var/www
Import starter database
mysql -u root -p < /var/www/gazelle.sql
Note: This will ask for the password entered earlier when the MySQL package was installed.
Edit site configuration file
sudo cp /var/www/classes/config.template /var/www/classes/config.php
sudo nano /var/www/classes/config.php
Note: Fill in everything minus IRC otherwise browsers will show a blank white page error.
Change /var/run/mysqld/mysql.sock
to /var/run/mysqld/mysqld.sock
Change site details and ports and fill in the encryption keys. (Named constant 'ENCKEY' must be 32 characters long.)
###Configure Sphinx###
sudo cp /var/www/sphinx.conf /etc/sphinxsearch/
sudo nano /etc/sphinxsearch/sphinx.conf
sudo mkdir /var/lib/sphinx
sudo mkdir /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/mysql/mysql.sock
to /var/run/mysqld/mysqld.sock
###Configure Ocelot###
Get Ocelot
wget https://what.cd/ocelot-0.7.tar.bz2 --no-check-certificate
tar -xvf ocelot-0.7.tar.bz2
cd ocelot-0.7
cp config.cpp.template config.cpp
nano config.cpp
Note: Edit MySQL details accordingly in config.cpp and change the port to 2710 if that is what was set in config.php (default).
Configure, Compile, Install
./configure --with-mysql-lib=/usr/lib/x86_64-linux-gnu/
make
sudo make install
###Create cron job for Gazelle jobs###
mkdir ~/logs
sudo crontab -e
Copy and paste the following:
0,15,30,45 * * * * php /var/www/schedule.php SCHEDULE_KEY >> /home/USER/logs/schedule.log
10,25,40,55 * * * * php /var/www/peerupdate.php SCHEDULE_KEY >> /home/USER/logs/peerupdate.log
* * * * * indexer -c /etc/sphinxsearch/sphinx.conf --rotate delta requests_delta
5 0,12 * * * indexer -c /etc/sphinxsearch/sphinx.conf --rotate --all
Note: Make sure you change KEY to the schedule key you used in config.php.
###Starting Gazelle processes at startup###
Memcached
sudo mv /etc/memcached.conf /etc/memcached.conf.bak
sudo nano /etc/memcached.conf
Copy and paste the following:
# Run memcached as a daemon. This command is implied, and is not needed for the
# daemon to run.
-d
# Log memcached's output to /var/log/memcached
logfile /var/log/memcached.log
# Start with a cap of 512 megs of memory.
# Note that the daemon will grow to this size,
# but does not start out holding this much memory
-m 512
# Unix socket path to listen on (disables network support).
-s /var/run/memcached.sock
# Permissions (in octal format) for Unix socket created with -s option.
-a 0777
# Run the daemon as root.
-u root
# Disable the use of CAS (and reduce the per-item size by 8 bytes).
-C
Press Ctrl+X
and select Yes.
Restart memcached to use the new configuration:
sudo service memcached restart
Sphinx
sudo nano /etc/init.d/searchd
Copy and paste the following:
#!/bin/bash
case "${1:-''}" in
'start')
/usr/bin/searchd
;;
'stop')
/usr/bin/searchd --stop
;;
'restart')
/usr/bin/searchd --stop && /usr/bin/searchd
;;
*)
echo "Usage: $SELF start|stop|restart"
exit 1
;;
esac
Press Ctrl+X
and select Yes.
Set correct permissions for script:
sudo chmod +x /etc/init.d/searchd
Set searchd service to be started on boot:
sudo update-rc.d searchd defaults
Start searchd:
sudo service searchd start
Ocelot
To start Ocelot, open a screen by typing screen
, and then start Ocelot by typing ocelot
.
To leave the screen, press Ctrl+A+D
.
To re-enter the screen, type screen -r
.
ocelot: error while loading shared libraries: libboost_iostreams.so.1.55.0: cannot open shared object file: No such file or directory
Solution:
env LD_LIBRARY_PATH=/usr/local/lib
But Canonical is not recommend LD_LIBRARY_PATH.
You will see white page of frontend and stuck make the Ocelot of backend.
/usr/bin/ld: site_comm.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
You can use LIBS for -lpthread.
But white page still not answer.