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

Tutorial: manually installing SphinxSearch from source via make and configure

peregrineperegrine MVP
edited June 2014 in Feedback

installing SphinxSearch from source via make and configure with SphinxSearch 20140114

tested on Linux system

Assumption you can ssh into your server to execute some things.

  • 1 go to sphinxsearch downloads page http://sphinxsearch.com/downloads/
  • 2 download source tarball (most current stable as of today is Sphinx 2.1.8-release (r4675; Apr 28, 2014)
  • 3 unzip it into a folder. I will use var/www/SphinxSrc as my extraction folder (where all files are unzipped).
  • 4 I will be installing all binaries, logs, etc into a folder I made called /var/www/Sphinx
  • 5 next go to folder /var/www/SphinxSrc (e.g. cd /var/www/SphinxSrc
  • 6 then type ./configure --prefix=/var/www/Sphinx
  • 7 then type make
  • 8 after make completes (assuming you have all the necessary compilers)
  • 9 all of the compiled files and log will be in /var/www/Sphinx
  • 10 location of two primary binaries will be here: /var/www/Sphinx/bin/indexer and /var/www/Sphinx/bin/searchd
  • 11 change permission on /var/www/Sphinx/var/data and /var/www/Sphinx/var/log so they are writeable.
  • 12 copy /var/www/Sphinx/etc/sphinx.conf.dist to /var/www/Sphinx/etc/sphinx.conf
  • 13 download the sphinxsearch plugin - I used http://vanillaforums.org/addon/sphinxsearch-plugin-20140114
  • 14 unzip and install plugin.
  • 15 login as root
  • 16 choose install wizard in SphinxSearch settings plugin thru step 2
  • 17 you will be asked to paste your sphinx.conf file in the form (use the /var/www/Sphinx/etc/sphinx.conf code)
  • 18 after completing step 2. then you will get generation of Congratulations . The sphinx configuration file has been created successfully.
  • 19 a) cut and paste this generated text of newly created sphinx configuration into /var/www/Sphinx/etc/sphinx.conf
  • 19 b) a change can be made in sphinx.conf. changed post to listen because port is deprecated.

searchd
{
listen = 9312

  • 20 then edit your config.php
  • to match these statements - don't remve any statements. just modify them as necessary.

    // Plugin
    $Configuration['Plugin']['SphinxSearch']['SearchdRunning'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['StartWizard'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['Config'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['Connection'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['Detection'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['Installed'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['Port'] = '9312';
    $Configuration['Plugin']['SphinxSearch']['Prefix'] = 'vss_';
    $Configuration['Plugin']['SphinxSearch']['IndexerPath'] = '/var/www/Sphinx/bin/indexer';
    $Configuration['Plugin']['SphinxSearch']['ConfPath'] = '/var/www/Sphinx/etc/sphinx.conf';
    

    /

 // leave the ['Plugin']['SphinxSearch']['ConfText']  that was created by the plugin
       $Configuration['Plugin']['SphinxSearch']['ConfText']  = // leave the conf that was created by the plugin  (it is snipped out here)
        $Configuration['Plugin']['SphinxSearch']['LogPath'] = '/var/www/Sphinx/var/log/searchd.log';
        $Configuration['Plugin']['SphinxSearch']['QueryPath'] = '/var/www/Sphinx/var/log/query.log';
        $Configuration['Plugin']['SphinxSearch']['PIDPath'] = '/var/www/Sphinx/var/log/searchd.pid';
        $Configuration['Plugin']['SphinxSearch']['DataPath'] = '/var/www/Sphinx/var/data/';
        $Configuration['Plugin']['SphinxSearch']['IndexerFound'] = TRUE;
        $Configuration['Plugin']['SphinxSearch']['SearchdFound'] = TRUE;
        $Configuration['Plugin']['SphinxSearch']['ConfFound'] = TRUE;
        $Configuration['Plugin']['SphinxSearch']['LimitResultsPage'] = 30;
        $Configuration['Plugin']['SphinxSearch']['MaxMatches'] = 1000;
        $Configuration['Plugin']['SphinxSearch']['MaxQueryTime'] = 0;
        $Configuration['Plugin']['SphinxSearch']['MainHitBoxEnable'] = TRUE;
        $Configuration['Plugin']['SphinxSearch']['LimitRelatedSearches'] = 20;
        $Configuration['Plugin']['SphinxSearch']['LimitTopKeywords'] = 20;
        $Configuration['Plugin']['SphinxSearch']['LimitTopSearches'] = 20;
        $Configuration['Plugin']['SphinxSearch']['LimitRelatedThreadsSidebarDiscussion'] = 20;
        $Configuration['Plugin']['SphinxSearch']['LimitRelatedThreadsMain'] = 20;
        $Configuration['Plugin']['SphinxSearch']['LimitRelatedThreadsPost'] = 20;
        $Configuration['Plugin']['SphinxSearch']['RelatedThreadsPostFormat'] = 'simple';
        $Configuration['Plugin']['SphinxSearch']['LimitRelatedThreadsBottomDiscussion'] = 20;
        $Configuration['Plugin']['SphinxSearch']['RelatedThreadsBottomDiscussionFormat'] = 'table';
        $Configuration['Plugin']['SphinxSearch']['MainSearchEnable'] = TRUE;
        $Configuration['Plugin']['SphinxSearch']['StatsEnable'] = TRUE;
        $Configuration['Plugin']['SphinxSearch']['RelatedEnable'] = TRUE;
        $Configuration['Plugin']['SphinxSearch']['SearchdPath'] = /var/www/Sphinx/bin/searchd;

21 - the create file in /var/www/Sphinx/bin/sphinxstart.sh with the following code

/var/www/Sphinx/bin/searchd --config /var/www/Sphinx/etc/sphinx.conf --stop
/var/www/Sphinx/bin/indexer --all --config /var/www/Sphinx/etc/sphinx.conf
/var/www/Sphinx/bin/searchd --config /var/www/Sphinx/etc/sphinx.conf

22 - run it like so from /var/www/Sphinx sh ./sphinxstart.sh

to start searchd and to index your vanilla forum
23 you can add the script to cron

24 - copy the SphinxSrc/api/sphinxapi.php to plugins/SphinxSearch/sphinxapi.php

25 - you should be running if you followed these steps.

of course if you are installing in a different folder than /var/www/Sphinx

e.g. /public/home/Sphinx

you would need to change /var/www/ everywhere in the instructions to /public/home/Sphinx

worked for me.

you may have an easier way, but this way works and is foolproof - if you can compile the code.

I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Comments

  • Options
    peregrineperegrine MVP
    edited June 2014

    After the sphinx.conf was created by the plugin, all I needed in config.php

    on second thought, all I needed in the end run for /conf/config.php sphinx related configs was

    $Configuration['Plugin']['SphinxSearch']['SearchdRunning'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['StartWizard'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['Config'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['Connection'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['Installed'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['Task'] = 'Idle';
    $Configuration['Plugin']['SphinxSearch']['Host'] = 'localhost';
    $Configuration['Plugin']['SphinxSearch']['Port'] = '9312';
    $Configuration['Plugin']['SphinxSearch']['Prefix'] = 'vss_';
    $Configuration['Plugin']['SphinxSearch']['LimitResultsPage'] = 30;
    $Configuration['Plugin']['SphinxSearch']['MaxMatches'] = 1000;
    $Configuration['Plugin']['SphinxSearch']['MaxQueryTime'] = 0;
    $Configuration['Plugin']['SphinxSearch']['MainHitBoxEnable'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['LimitRelatedSearches'] = 20;
    $Configuration['Plugin']['SphinxSearch']['LimitTopKeywords'] = 20;
    $Configuration['Plugin']['SphinxSearch']['LimitTopSearches'] = 20;
    $Configuration['Plugin']['SphinxSearch']['LimitRelatedThreadsSidebarDiscussion'] = 20;
    $Configuration['Plugin']['SphinxSearch']['LimitRelatedThreadsMain'] = 20;
    $Configuration['Plugin']['SphinxSearch']['LimitRelatedThreadsPost'] = 20;
    $Configuration['Plugin']['SphinxSearch']['RelatedThreadsPostFormat'] = 'simple';
    $Configuration['Plugin']['SphinxSearch']['LimitRelatedThreadsBottomDiscussion'] = 20;
    $Configuration['Plugin']['SphinxSearch']['RelatedThreadsBottomDiscussionFormat'] = 'table';
    $Configuration['Plugin']['SphinxSearch']['MainSearchEnable'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['StatsEnable'] = TRUE;
    $Configuration['Plugin']['SphinxSearch']['RelatedEnable'] = TRUE;
    

    and perhaps less.

    what else could be deleted? mcu_hq

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.