(Translated by https://www.hiragana.jp/)
gazelle on ubuntu 17.10 · WhatCD/Gazelle Wiki · GitHub
Skip to content

gazelle on ubuntu 17.10

hide edited this page Dec 3, 2018 · 4 revisions

starting with a clean install of ubuntu 17.10 x64 desktop version update the system packages, install ssh, etc...

then:

sudo apt-get install python-software-properties software-properties-common
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update


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 \
php7.0-fpm php-soap php-pear php7.0-memcache php7.0-curl php7.0-mysql php7.0-mcrypt php7.0-gd sendmail

sudo apt-get install make g++ libbz2-dev libtcmalloc-minimal4

sudo ln -s /usr/lib/libtcmalloc_minimal.so.4 /usr/lib/libtcmalloc.so

Install Boost libraries:

Note: i modified these instructions from the ubuntu 16.04 thing

tar -jxf boost_1_66_0.tar.bz2
cd /boost_1_66_0

./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

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.

NOTE: i got 'ERROR 1067 (42000) at line 89: Invalid default value for 'Time'

which refers to this part of gazelle.sql:

CREATE TABLE blog(IDint(10) unsigned NOT NULL AUTO_INCREMENT,UserIDint(10) unsigned NOT NULL,Titlevarchar(255) NOT NULL,Bodytext NOT NULL,Timedatetime NOT NULL DEFAULT '0000-00-00 00:00:00',ThreadIDint(10) unsigned DEFAULT NULL,Important tinyint(4) NOT NULL DEFAULT '0',nano PRIMARY KEY (ID), KEY UserID (UserID), KEY Time (Time) ) ENGINE=InnoDB CHARSET utf8;

according to this here https://stackoverflow.com/questions/36374335/error-in-mysql-when-setting-default-value-for-date-or-datetime

so im going to try changing the default time to 1000-01-01 00:00:00 rather than changing strict table mode or whatever

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 Note: this throws a fatal error about compat_sphinxql_magics not being something it understands or something

go back to sphinx.conf and delete this line: 'compat_sphinxql_magics = 0'

Configure Ocelot

Get Ocelot Note: what.cd was killed by the pirate police so you cant download the source from there so do this

git clone https://github.com/WhatCD/Ocelot.git
cd ocelot
cp config.cpp config.cpp.backup
nano config.cpp

./configure --with-mysql-lib=/usr/lib/x86_64-linux-gnu/ --with-ev-lib=/usr/lib/x86_64-linux-gnu/ --with-boost-libdir=/usr/lib/x86_64-linux-gnu

Note: whats this site password thing?

comment: hardcoded config details?

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

sudo apt install autoconf

autoreconf -f -i

./configure --with-mysql-lib=/usr/lib/x86_64-linux-gnu/ --with-ev-lib=/usr/lib/x86_64-linux-gnu/ --with-boost-libdir=/usr/lib/x86_64-linux-gnu

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 123123123 >> /home/USER/logs/schedule.log
10,25,40,55 * * * * php /var/www/peerupdate.php 123123123 >> /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:

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 LD_LIBRARY_PATH=/usr/local/lib ocelot.

To leave the screen, press Ctrl+A+D.

To re-enter the screen, type screen -r.

at this point im getting the white page error, maybe because i havent done the php config file correctly but im giving up on this for now i hope this helps.

TO FIX BLANK PAGE PLEASE DON'T FORGET TO CONFIG IRC STUFF