How to Install Sphinx on CentOS
Posted: May 30, 2013 by Don Wilson
When you need a powerful and lightweight search engine for your website, Sphinx Search should be near the top of your list of possible solutions. Sphinx is free, open source, and has a small memory footprint. With it's streamlined use with MySQL and powerful index and search configurations, Sphinx was a clear choice when we built some of the most powerful tools on Celebrity Networth. Sphinx not only powers the custom search engine, but also powers related content sections and our autosuggest feature on search boxes.
How to Install Sphinx on CentOS
First, you'll need to find out which flavor of CentOS you have. In order to do so, open the command line and run
uname -r. Look specifically for two things:
el6 for the version of CentOS and
i686 for the architecture. The former is which version of CentOS you have:
el5 is CentOS 5 and
el6 is CentOS 6 (el standing for Enterprise Linux, the linux foundation CentOS is built on). The latter is which architecture your Operating System uses:
i686 for 32bit or
x86_64 for 64bit.
With both of these in mind, we'll download Sphinx using wget. To find the download link of Sphinx for your specific CentOS version, open a window to Sphinx 2.0.8-release downloads and find the matching
RHEL/CentOS X.x XXX RPM download link. Click the download link, skip the form and copy the anchor link at the bottom of the page labeled "I accept GPLv2, give me the file!".
Back to your command line, run the command
cd ~ to return to your home directory. If you're not on the root account, do so by typing
su root and providing your root account's password. Then, type
wget http://sphinxsearch.com/files/sphinx-2.0.8-1.rhel5.x86_64.rpm replacing the URL with the download link you copied earlier.
Use Yum to install Sphinx Search CentOS locally
Once the download has completed, type
ll to make sure the file is in your directory. Then type
yum localinstall --nogpgcheck sphinx-2.0.8-1.rhel6.x86_64.rpm, again replacing the filename with the file in your directory (you can use the
[tab] key to auto-complete the filename after a few characters). Run that command, type
y and hit enter when yum asks you to verify the installation.
If the installation of Sphinx Search is successful, you'll be presented with a few examples of how to start inserting and searching data.
Where to go from here?
Sphinx Search has wonderful documentation on configuring your Sphinx Search configuration file, typically installed to
/etc/sphinx/sphinx.conf. The source code of Sphinx Search includes Python and PHP libraries for communicating with your newly installed Sphinx Search daemon. Use of these libraries is strongly recommended over the Sphinx PECL library as the PECL library is likely to be outdated with the newest version of Sphinx.
If your installation doesn't work, or you have any questions about what Sphinx can do, please feel free to leave a comment.
Quick Installation of Sphinx Search on CentOS
Install Sphinx on CentOS 5 32-bit
wget http://sphinxsearch.com/files/sphinx-2.0.8-1.rhel5.i386.rpm yum localinstall --nogpgchec sphinx-2.0.8-1.rhel5.i386.rpm
Install Sphinx on CentOS 5 64-bit
wget http://sphinxsearch.com/files/sphinx-2.0.8-1.rhel5.x86_64.rpm yum localinstall --nogpgchec sphinx-2.0.8-1.rhel5.x86_64.rpm
Install Sphinx on CentOS 6 32-bit
wget http://sphinxsearch.com/files/sphinx-2.0.8-1.rhel6.i386.rpm yum localinstall --nogpgchec sphinx-2.0.8-1.rhel6.i386.rpm
Install Sphinx on CentOS 6 64-bit
wget http://sphinxsearch.com/files/sphinx-2.0.8-1.rhel6.x86_64.rpm yum localinstall --nogpgchec sphinx-2.0.8-1.rhel6.x86_64.rpm