Skip to content

Instantly share code, notes, and snippets.

@wbotelhos
Last active December 19, 2015 02:18
Show Gist options
  • Save wbotelhos/5881693 to your computer and use it in GitHub Desktop.
Save wbotelhos/5881693 to your computer and use it in GitHub Desktop.
Sphinx Install

Install

sudo mkdir -p /opt/local/src
cd /opt/local/src
sudo wget http://sphinxsearch.com/files/sphinx-2.1.3-release.tar.gz
sudo tar xvf sphinx-2.1.3-release.tar.gz
cd sphinx-2.1.3-release
sudo ./configure --prefix=/opt/local/sphinx/2.1.3

sudo make && sudo make install
sudo ln -s /opt/local/sphinx/2.1.3 /opt/local/sphinx/current
sudo mkdir -p /opt/local/bin
sudo mkdir -p /opt/local/sbin

sudo ln -s /opt/local/sphinx/current/bin/indexer /opt/local/bin/indexer
sudo ln -s /opt/local/sphinx/current/bin/indextool /opt/local/bin/indextool
sudo ln -s /opt/local/sphinx/current/bin/search /opt/local/bin/search
sudo ln -s /opt/local/sphinx/current/bin/searchd /opt/local/bin/searchd
sudo ln -s /opt/local/sphinx/current/bin/spelldump /opt/local/bin/spelldump

sudo ln -s /opt/local/sphinx/current/sbin/indexer /opt/local/sbin/indexer
sudo ln -s /opt/local/sphinx/current/sbin/indextool /opt/local/sbin/indextool
sudo ln -s /opt/local/sphinx/current/sbin/search /opt/local/sbin/search
sudo ln -s /opt/local/sphinx/current/sbin/searchd /opt/local/sbin/searchd
sudo ln -s /opt/local/sphinx/current/sbin/spelldump /opt/local/sbin/spelldump

searchd

sphinx.yml

vim /var/www/wbotelhos/config/sphinx.yml
production:
  config_file:       '/var/www/wbotelhos/config/sphinx.conf'
  searchd_file_path: '/var/www/wbotelhos/shared/sphinx'

sphinx.conf

sudo vim /etc/init/sphinx.conf
description 'sphinx'

start on startup
stop on shutdown

console output
respawn

exec sudo -u deploy -g ubuntu sh -c 'searchd -c /home/ubuntu/www/wbotelhos-br/config/sphinx.conf --nodetach'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment