1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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:
    Code (Text):
    1. #! /bin/sh
    2. #
    3. #              Written by Shawn Hogan
    4. #
    5. # Comments to support LSB init script conventions
    6. ### BEGIN INIT INFO
    7. # Provides: searchd
    8. # Required-Start: $local_fs $network $remote_fs
    9. # Required-Stop: $local_fs $network $remote_fs
    10. # Default-Start:  2 3 4 5
    11. # Default-Stop: 0 1 6
    12. # Short-Description: start and stop searchd
    13. # Description: searchd is the search daemon portion of Sphinx
    14. ### END INIT INFO
    15.  
    16.  
    17. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    18. DAEMON=/usr/local/bin/searchd
    19. NAME=searchd
    20. DESC=searchd
    21. PIDFILE=/home/sphinx/$NAME.pid
    22.  
    23. test -x $DAEMON || exit 0
    24. ##test -x $DAEMONBOOTSTRAP || exit 0
    25.  
    26. set -e
    27.  
    28. case "$1" in
    29. start)
    30. echo -n "Starting $DESC: "
    31. nohup $DAEMON > /dev/null 2>&1 &
    32. echo "$NAME."
    33. ;;
    34. stop)
    35. echo -n "Stopping $DESC: "
    36. killproc -p $PIDFILE $DAEMON
    37. echo "$NAME."
    38. rm -f $PIDFILE
    39. ;;
    40. restart)
    41. echo -n "Stopping $DESC: "
    42. killproc -p $PIDFILE $DAEMON
    43. rm -f $PIDFILE
    44. echo -n "Starting $DESC: "
    45. $DAEMON 2>&1 &
    46. ;;
    47. *)
    48. N=/etc/init.d/$NAME
    49. echo "Usage: $N {start|stop|restart}" >&2
    50. exit 1
    51. ;;
    52. esac
    53.  
    54. exit 0
    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):
    Code (Text):
    1. enable service ../searchd -> /etc/init.d/rc2.d/S12searchd
    2. enable service ../searchd -> /etc/init.d/rc2.d/K11searchd
    3. enable service ../searchd -> /etc/init.d/rc3.d/S12searchd
    4. enable service ../searchd -> /etc/init.d/rc3.d/K11searchd
    5. enable service ../searchd -> /etc/init.d/rc4.d/S12searchd
    6. enable service ../searchd -> /etc/init.d/rc4.d/K11searchd
    7. enable service ../searchd -> /etc/init.d/rc5.d/S12searchd
    8. enable service ../searchd -> /etc/init.d/rc5.d/K11searchd
    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:
    110
    #2
    nice article :)
    letsjoy, Sep 9, 2010 IP
  3. Paul Brand

    Paul Brand Greenhorn

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #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 Greenhorn

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #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 Member

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #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 Prominent Member

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

    digitalpoint Overlord of no one Staff

    Messages:
    36,132
    Likes Received:
    2,245
    Best Answers:
    391
    Trophy Points:
    710
    Digital Goods:
    27
    #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,062
    Likes Received:
    58
    Best Answers:
    0
    Trophy Points:
    110
    #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 Member

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