Tips / Nginx

How to install Sphinx on CentOS


Sphinx is an open source and free text search server. It was designed from scratch with performance, search quality and easy integration in mind. Written in C++, works on most modern Linux distributions (RHEL, CentOS, Fedora, Ubuntu),MacOS, FreeBSD and even on Windows.

One of the advantages that Sphinx offers is the fact that the text server lets you create the DB index and then save it in various formats, including a SQL database, NoSQL storage or even simple text files. Easy and simple, search on the fly without performance issues!

So, now that you know what Sphinx is, let’s install it

Install some required libs:

yum install unixODBC-libs unixODBC -y

Grab the latest version from here:

mkdir /root/temp/
cd /root/temp

Now install the downloaded rpm:

rpm -i sphinx-2.1.8-1.rhel5.x86_64.rpm

You should see something like this:

Sphinx installed!
Now create a full-text index, start the search daemon, and you're all set.

To manage indexes:
editor /etc/sphinx/sphinx.conf

To rebuild all disk indexes:
sudo -u sphinx indexer --all --rotate

To start/stop search daemon:
service searchd start/stop

To query search daemon using MySQL client:
mysql -h 0 -P 9306
mysql> SELECT * FROM test1 WHERE MATCH('test');

See the manual at /usr/share/doc/sphinx-2.1.8 for details.

For commercial support please contact Sphinx Technologies Inc at

Once you have configured sphinx properly at /etc/sphinx/sphinx.conf, run the indexer (sudo -u sphinx indexer –all –rotate) and after that just start Sphinx:

service searchd start

Finally add it to the boot system:

chkconfig searchd on

Popular search terms:

  • sphinx _static nginx
  • sphinx centos 8
  • unixODBC-libs for RHEL 6
  • centos sphinx plugun phpmyadmin

Esteban Borges

Linux Geek, Webperf Addict, Nginx Fan. CTO @Infranetworking