HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

HOWTO install Sphinx Search on Ubuntu 14.04

edited August 2015 in Feedback

Since I found a few differences in the above documented procedure, and a bit of time has passed, I wrote this in hopes it helps others.

HOWTO upgrade your Vanilla search to Sphinx Search on Ubuntu 14.04

Pre-install best practices

  • Upgrade your vanilla install to the latest version - 2.1.11 as of this writing
  • Upgrade your plugins to latest versions - I recommend you install version check plugin - it's a great way to keep tabs on this
  • Upgrade your OS patches - I'm assuming Ubuntu 14.04 x64 for this
  • Take a db backup - never huts...

Install

  • Install sphinxsearch OS package: (NOTE I had a problem using sphinxsearch 2.3 version from website, stick to version in your OS repos)
  • apt-get install sphinxsearch
  • Install sphinxsearch vanilla plugin, don't activate it yet...
  • Download sphinxsearch source tarball of the same version (2.0.4 as of this writing) from http://sphinxsearch.com/downloads/archive/
  • Untar sphinxsearch source from above and copy $srcdir/api/sphinxphp.api over $vanilla_dir/plugins/SphinxSearch/sphinxphp.api
  • Enble sphinxsearch plugin and click 'settings'
  • Click on install wizard link in the plugin, click start wizard button
  • Step 1 - change nothing, unless you're using a remote mysql database - then enter your DB IP, not localhost, click save and continue
  • Step 2 - copy and paste contents of /etc/sphinxsearch/sphinx.conf.sample into windows that says "paste your text here" (remove paste your text here text first...)
  • Click save and continue
  • Copy the newly generated sphinx.conf file under "Congratulations!" to /etc/sphinxsearch/sphinx.conf
  • Start initial indexing: /usr/bin/indexer --all --config /etc/sphinxsearch/sphinx.conf
  • If you get an error here, make sure your credentials and db setting in /etc/sphinxsearch/sphinx.conf are correct and that the sphinx plugin is enabled...
  • Enable sphinx search daemon startup scripts:
  • sudo update-rc.d sphinxsearch defaults
  • Enable autostart on boot - edit /etc/default/sphinxsearch and change START=no to START=yes
  • Start searchd - /etc/init.d/sphinxsearch start
  • Go back to browser window to configure cronjobs in "step 3"
  • Enter /etc/sphinxsearch/sphinx.conf in "conf path"
  • Click 'save and continue' - done!
  • cronjobs scripts are saved in $vanilla/plugins/SphinxSearch/cron/cron.reindex.* - *** you MUST manually edit root's cron and add these 3 entries in yourself
  • Test if out
  • Optional: dump your Mysql vanilla DB, edit the 3 newly created tables to change their type from 'MyISAM' to 'InnoDB' -- N.B. I like to run all my MySQL tables as InnoDB, and Amazon Web Services RDS complains if you don't...
Tagged:

Comments

  • If you want to try the Sphinx 2.3.X debs that come from the main website... I assume over time, they'll work properly. This looks like it could be related to the issue I saw with Sphinx 2.3.1 not working properly in my tests: https://www.mediawiki.org/wiki/Extension:SphinxSearch - Sphinx search 2.3.1 Note: Works with sphinxapi.php from 2.1.1. Api provided with 2.3.1 gives deprecated fault with a hint to SphinxQL! --

  • mcu_hqmcu_hq yippie ki-yay ✭✭✭
    edited August 2015

    @rosscampbell nice write up! I'm sure lot of fellow Ubuntu users will benefit from that. It is sometimes a pain to get Sphinx installed.

    I'm seeing that Sphinx has the latest stable as being 2.2.9 as of this writing. Like you said, maybe it is something wrong in their 2.3.1 beta API that is causing the problem. I haven't touched this plugin in a few years and sphinx, as wella as the vanilla core team, has kept a very fine job of backwards compatibility. If they move it to stable and it still isn't working, I'll need to investigate

  • I get all the way to Step 3 and continue and I get a 500 code error when i press save and continue. I'm using 2.2 vanilla. whats the best way i can figure out how to fix this? or where to look?

  • R_JR_J Ex-Fanboy Munich Admin

    When you get a 500 response, check your server logs.

Sign In or Register to comment.