Sphinx Installation

Discussion in 'Site & Server Administration' started by digitalpoint, Sep 1, 2010.

  1. #1
    Sphinx comes in various pre-compiled packages (Windows, Red Hat, etc.), so if your operating system has a version already compiled and ready to install, you may just want to install one of those and be done with it.

    You can find pre-compiled versions as well as source files (if you want to compile your own) here:

    http://sphinxsearch.com/downloads/

    This installation guide is designed for people who want to install/compile from source on a Linux system (and have admin/shell access)...

    Log into your server's shell as root, and run the following commands (in order, obviously).
    1. curl -O http://sphinxsearch.com/files/sphinx-2.0.6-release.tar.gz
    2. tar -xzvf sphinx-2.0.6-release.tar.gz
    3. cd sphinx-2.0.6-release
    4. ./configure
    5. make
    6. make install
    7. mkdir /home/sphinx
    8. mkdir /home/sphinx-data
    9. mkdir /usr/local/etc
    There are two parts to Sphinx... the indexer program and the searchd program. Searchd is a daemon that listens for search requests and should always be running. Because of this, it's a good idea to setup a mechanism so it automatically loads when the server boots.

    If your system supports init.d, you can create a /etc/init.d/searchd file with the following contents:
    #! /bin/sh
    #
    #              Written by Shawn Hogan
    #
    # Comments to support LSB init script conventions
    ### BEGIN INIT INFO
    # Provides: searchd
    # Required-Start: $local_fs $network $remote_fs
    # Required-Stop: $local_fs $network $remote_fs
    # Default-Start:  2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: start and stop searchd
    # Description: searchd is the search daemon portion of Sphinx
    ### END INIT INFO
     
     
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    DAEMON=/usr/local/bin/searchd
    NAME=searchd
    DESC=searchd
    PIDFILE=/home/sphinx/$NAME.pid
     
    test -x $DAEMON || exit 0
    ##test -x $DAEMONBOOTSTRAP || exit 0
     
    set -e
     
    case "$1" in
    start)
    echo -n "Starting $DESC: "
    nohup $DAEMON > /dev/null 2>&1 &
    echo "$NAME."
    ;;
    stop)
    echo -n "Stopping $DESC: "
    killproc -p $PIDFILE $DAEMON
    echo "$NAME."
    rm -f $PIDFILE
    ;;
    restart)
    echo -n "Stopping $DESC: "
    killproc -p $PIDFILE $DAEMON
    rm -f $PIDFILE
    echo -n "Starting $DESC: "
    $DAEMON 2>&1 &
    ;;
    *)
    N=/etc/init.d/$NAME
    echo "Usage: $N {start|stop|restart}" >&2
    exit 1
    ;;
    esac
     
    exit 0
    Code (markup):
    The run the following command from your shell to activate it for the various run-levels: insserv -vd /etc/init.d/searchd

    The command should give you something along the lines of (which is a good thing):
    enable service ../searchd -> /etc/init.d/rc2.d/S12searchd
    enable service ../searchd -> /etc/init.d/rc2.d/K11searchd
    enable service ../searchd -> /etc/init.d/rc3.d/S12searchd
    enable service ../searchd -> /etc/init.d/rc3.d/K11searchd
    enable service ../searchd -> /etc/init.d/rc4.d/S12searchd
    enable service ../searchd -> /etc/init.d/rc4.d/K11searchd
    enable service ../searchd -> /etc/init.d/rc5.d/S12searchd
    enable service ../searchd -> /etc/init.d/rc5.d/K11searchd
    Code (markup):
    Now searchd *should* start on it's own when you reboot your server.

    Go ahead and start the searchd daemon by running the /etc/init.d/searchd start command. If all went as planned, you should be good to go now! :)
     
    Last edited: Mar 4, 2013
    digitalpoint, Sep 1, 2010 IP
  2. letsjoy

    letsjoy Well-Known Member

    Messages:
    1,166
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    160
    #2
    nice article :)
     
    letsjoy, Sep 9, 2010 IP
  3. Paul Brand

    Paul Brand Member

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Great article!
     
    Paul Brand, Sep 14, 2010 IP
  4. 5alam83

    5alam83 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    best articles to me , thanks
     
    5alam83, Sep 14, 2010 IP
  5. Paul Brand

    Paul Brand Member

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    insserv statement does not work on my centos server:
    # insserv -vd /etc/init.d/searchd
    -> -bash: insserv: command not found
    As much as I found out, this program does not work on centos at all.

    This is what I found to start init.d on centos (I tried to post the link but am not allowed to do that)
    # chkconfig --level 345 searchd on

    Not sure if this is right!
     
    Paul Brand, Sep 15, 2010 IP
  6. mamas86

    mamas86 Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    really nice article, thanks
     
    mamas86, Sep 18, 2010 IP
  7. Jasmina Krstic

    Jasmina Krstic Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yeah,nice article.Thank you very much!!!
    Greetings from Tamara
     
    Jasmina Krstic, Sep 18, 2010 IP
  8. ITech Troubleshooter

    ITech Troubleshooter Well-Known Member

    Messages:
    114
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    141
    #8
    this article helpful for me.
     
    ITech Troubleshooter, Sep 21, 2010 IP
  9. avsa.gen.tr

    avsa.gen.tr Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Nice article thanks
     
    avsa.gen.tr, Sep 26, 2010 IP
  10. Gino Robin

    Gino Robin Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    You have certainly good experience in this field

    Thanks
    Gino
     
    Gino Robin, Sep 27, 2010 IP
  11. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,932
    Likes Received:
    1,022
    Best Answers:
    0
    Trophy Points:
    455
    #11
    Shawn, you really write all these articles yourself?
     
    DomainMagnate, Sep 28, 2010 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #12
    Yeah, why?
     
    digitalpoint, Sep 28, 2010 IP
  13. promoteadsenze

    promoteadsenze Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Good for all...:eek:
     
    promoteadsenze, Oct 3, 2010 IP
  14. rihana.crazy

    rihana.crazy Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Thats one real informative article !!
    Kudos :)
     
    rihana.crazy, Oct 9, 2010 IP
  15. yuyus

    yuyus Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    thank you for the information
     
    yuyus, Oct 9, 2010 IP
  16. mdraja123

    mdraja123 Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    very much informative article, thank you.
     
    mdraja123, Oct 18, 2010 IP
  17. Lordo

    Lordo Well-Known Member

    Messages:
    2,082
    Likes Received:
    58
    Best Answers:
    0
    Trophy Points:
    190
    #17
    And how will it be connected to the forums? Is there a known interface?
     
    Lordo, Oct 25, 2010 IP
  18. manggatal

    manggatal Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    great post, thanks for share bro.
     
    manggatal, Nov 13, 2010 IP
  19. Titusaha

    Titusaha Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Buddy you sure know how ho rock and roll. Thanks for such informative article
     
    Titusaha, Nov 18, 2010 IP
  20. jonasl

    jonasl Active Member

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    61
    #20
    Thanks. This guide is for redhat, right?
     
    jonasl, Nov 23, 2010 IP