Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Manual Installs

This discussion is related to the SphinxSearch addon.
edited August 2012 in Vanilla 2.0 - 2.8

Is there a way to have the installer generate a .conf file for me if I choose to use a distro supplied sphinx installation. Having my webserver run another process from within PHP is not something I'm comfortable with security wise.

«1

Comments

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭
    edited August 2012

    Yes, this is one of the main reasons why I have that option. I actually used the AUR package of sphinx search from Arch Linux to install mine.

    What you need to do is install sphinx via your distro manager. Then, you have to click the 'manual install' radio button and fill in the indexer, searchd, and sphinx.conf file paths. Your package manager should install a sphinx.conf that has some important info in it, such as log paths and data paths. The plugin will parse your config file for important info such as this.

    If it found everything, you can proceed to step 3 which will overwrite your sphinx.conf that is from your installer. So you may want to make a backup of your sphinx.conf just in case.

    Let me know how it goes. if you have problems, PM me your distro's sphinx.conf after taking out your username/password in it of course.

  • So then if I want to do a non-privledged install I can just copy my distro sphinx.conf to the vanilla folder, tell the plugin that's my real conf, wait for it to overwrite, then manually copy the config to it's real home.
    Do you see this causing any problems?

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭
    edited August 2012

    no, just leave everything where your distro places it. Then tell the plugin where to find these 3 files. Just be sure to backup your distro's sphinx.conf just in case. Sphinx should then refeclt all of your distro settings.

    I don't know what you mean by "non-privledged"

  • I don't run PHP as a user that has access to things other than what it absolutely has to as a matter of security. So it doesn't have permission to overwrite a .conf file that resides outside of the webroot.

  • edited August 2012

    Looks like I got it working, I'm going to have to manually run the indexes though since the PHP user doesn't have permission the the sphinx database files but that's fine.

    Also you should update the header of the cron files you generate, they all say they are the delta files.

    I have delta setup to do every 5 minutes, main to daily, what should I have the cron for stats run at? Actually it looks like you don't have different files for those two, the stats cron file is the exact same as the main one

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭
    edited August 2012

    Gillingham
    Looks like I got it working,

    Well that is a good start!

    I'm going to have to manually run the indexes though since the PHP user doesn't have permission the the sphinx database files but that's fine.

    Can you not setup a cron task inside of crontab? If not, I was thinking that I could create a URL on your site that you can call peroidically that will execute. I'll put some authentication or someting in the URL.

    I have delta setup to do every 5 minutes, main to daily, what should I have the cron for stats run at?

    I would delta 5 times a day and do main once a day at like 4AM. Stats is up to you....it keeps track of your search history. I would do with your main. Then again, it all really depends on your website traffic

    Actually it looks like you don't have different files for those two, the stats cron file is the exact same as the main one

    Good catch..I'll fix this in the next release here shortly

  • In todays release you fixed the time comments but the path to the actual .php script in the cron entry is still incorrect in the stats and main. Also, stats and main are also still the same file otherwise.
    Thanks for you work

  • peregrineperegrine MVP
    edited August 2012

    @mcu_hq

    I'm doing a manual install.

    I have been successful with the following.

    http://www.howtoforge.com/how-to-install-sphinx-on-ubuntu-10.10

    can you post a sample sphinx.conf that has a query with vanilla so I can cut and paste the parts I want (it would save me alot of time).

    does Can't find indexer at path: Not Detected

    mean the sphinx.conf is wrong.

    or does it mean it can't find the path to indexer executeable.

    which on my machine is at
    /usr/bin/indexer

    when I run a test on sphinx manually for a test database it works

    /etc/sphinxsearch# search test
    Sphinx 0.9.8.1-release (r1533)
    Copyright (c) 2001-2008, Andrew Aksyonoff
    
    using config file '/etc/sphinxsearch/sphinx.conf'...
    index 'test1': query 'test ': returned 3 matches of 3 total in 0.000 sec
    
    displaying matches:
    1. document=1, weight=2, group_id=1, date_added=Tue Aug  7 10:22:41 2012
        id=1
        group_id=1
        group_id2=5
        date_added=2012-08-07 10:22:41
        title=test one
        content=this is my test document number one. also checking search within phrases.
    2. document=2, weight=2, group_id=1, date_added=Tue Aug  7 10:22:41 2012
        id=2
        group_id=1
        group_id2=6
        date_added=2012-08-07 10:22:41
        title=test two
        content=this is my test document number two
    3. document=4, weight=1, group_id=2, date_added=Tue Aug  7 10:22:41 2012
        id=4
        group_id=2
        group_id2=8
        date_added=2012-08-07 10:22:41
        title=doc number four
        content=this is to test groups
    
    words:
    1. 'test': 3 documents, 5 hits
    
    

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

  • Just do what I did, copy your working sphinx conf into the plugin folder and tell the installer to use that, then let it make it's changes and copy it over to the real sphinx location.

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭

    Gillingham said:
    In todays release you fixed the time comments but the path to the actual .php script in the cron entry is still incorrect in the stats and main. Also, stats and main are also still the same file otherwise.
    Thanks for you work

    Oh yea, now I see what caused this....I got carried away with copying pasting...

    This is where the problem is: https://github.com/mcuhq/SphinxSearchPlugin/blob/master/class.sphinxsearchinstall.php#L193

    Just change that to: ReWritedStats for the time being. I'll fix it in the next release. Thanks

    peregrine said:
    can you post a sample sphinx.conf that has a query with vanilla so I can cut and paste the parts I want (it would save me alot of time).

    It would probably be easier if you used the manual install method in the plugin and point it towards where the indexer/searchd/sphinx.conf that your distro created. Make a backup of your sphinx.conf first and then proceed to step 3.

    My sphinx.conf will differ greatly than yours, and anyone else since it is closely tied to your setup, database stuff, password, etc. It would be a pain in the ass to edit it manually.

  • peregrineperegrine MVP
    edited August 2012

    I don't see a manual install method. i see install wizard. I click it and it does nothing.

    Can you point me to an image - I wanted to do that but I can't find it.

    meanwhile - I

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

  • peregrineperegrine MVP
    edited August 2012

    actually it would be easier for me if you posted a sample config -

    but no problem - I'll figure it out myself, if I can.

    the question still remains....

    does Can't find indexer at path: Not Detected -(very Ambiguous)

    mean the sphinx.conf has wrong path for the index itself.

    or does it mean it can't find the path to indexer executeable.

    which on my machine is at /usr/bin/indexer

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

  • peregrineperegrine MVP
    edited August 2012

    .

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

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭

    When you first start the plugin, you should get that error. You have to start the wizard by clicking the button, "start wizard", do step 1, and then step 2 is the manual step.

    peregrine
  • peregrineperegrine MVP
    edited August 2012

    When you first start the plugin, you should get that error. You have to start the wizard by clicking the button, "start wizard", do step 1, and then step 2 is the manual step.

    my mistake - it was hidden from view on my machine - I'll let you know.

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

  • peregrineperegrine MVP
    edited August 2012

    my conf gets parse errors.

    /usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf
    Sphinx 0.9.8.1-release (r1533)
    Copyright (c) 2001-2008, Andrew Aksyonoff
    
    using config file '/etc/sphinxsearch/sphinx.conf'...
    ERROR: unknown key name 'sql_field_string' in /etc/sphinxsearch/sphinx.conf line 42 col 18.
    FATAL: failed to parse config file '/etc/sphinxsearch/sphinx.conf'
    
    e.g. this line
    
    sql_field_string = user #don't require sql call to get username when filtring by user on the main search page
    
    
    ---
    I can remove that line and then it gets more parse errors on about 10 other variables.
    
    
    if I remove offending lines with parser errors I ultimately get
    
    /usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf
    

    Sphinx 0.9.8.1-release (r1533)
    Copyright (c) 2001-2008, Andrew Aksyonoff

    using config file '/etc/sphinxsearch/sphinx.conf'...
    creating server socket on 0.0.0.0:9312

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

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭

    Thanks Peregrine for trying it out!

    Can you PM me your auto generated config file? Be sure to take out your password/username

  • peregrineperegrine MVP
    edited August 2012

    Sure. sent

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

  • I get this error when I click on reload main.
    Indexer: Main Delta Stats
    Count of Docs: 0 0

    Fatal error: Class 'WidgetStats' not found in /var/www/vanilla/plugins/SphinxSearch/class.sphinxsearch.plugin.php on line 430 Call Stack: 0.0004 338868 1. {main}() /var/www/vanilla/index.php:0 0.9113 8788668 2. Gdn_Dispatcher->Dispatch() /var/www/vanilla/index.php:53 0.9689 9666768 3. Gdn_PluginManager->CallNewMethod() /var/www/vanilla/library/core/class.dispatcher.php:313 1.0063 10369720 4. SphinxSearchPlugin->PluginController_SphinxSearch_Create() /var/www/vanilla/library/core/class.pluginmanager.php:713 1.0462 10986024 5. Gdn_Plugin->Dispatch() /var/www/vanilla/plugins/SphinxSearch/class.sphinxsearch.plugin.php:205 1.0463 10986536 6. call_user_func() /var/www/vanilla/library/core/class.plugin.php:250 1.0464 10986564 7. SphinxSearchPlugin->Controller_Index() /var/www/vanilla/library/core/class.plugin.php:0

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

  • peregrineperegrine MVP
    edited August 2012

    I have to manually force turn this on even though searchd is running

    $Configuration['Plugin']['SphinxSearch']['SearchdRunning'] = TRUE;

    and now I can see the widgets (the finally stumbling block.

    something is wrong with the check to see if the process exists.

    $Configuration['Plugin']['SphinxSearch']['PIDPath'] = '/var/run/searchd.pid';

    because the pid is present.

    why two checks for daemon and process id - neither of which work on my brand of linux.

    I wonder if all the path settings would be better placed in a separate annotated config file instead of config.php.

    now I have to manually remove 14 lines from sphinx.conf every time I modify the dashboard setting for the plugin.

    I can see your search box now - but it doesn't find anything. Not sure if it is glitches or me.

    You have done some amazing things -

    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.