Category:
To start with we will download the sphinx package first. This installation guide is based on Fedora 16 and Sphinx 2.0.3-release package.
So, download the packages from here,
- Sphinx 2.0.3-release download the Source tarball (tar.gz).
-
Or, you can just use wget to download the package.
wget http://sphinxsearch.com/files/sphinx-2.0.3-release.tar.gz
I thought of installing it in the /usr/local directory. So, navigate to the directory. Then copy the package over there. And then extract it. This will look like the below screenshot.
After the extract the package will create a new directory as sphinx-2.0.3-release. I am attaching another screenshot for the reference.
Now, we will configure the Sphinx. I am writing those as step by step. So you will know which one to follow first.
-
Step 1. In the first step, we need to configure the Sphinx package. So to do that enter in the sphinx-2.0.3-release directory. Then, run the configuration program as,
./configure --prefix=/usr/local/sphinx
This one will install sphinx in the /usr/local/sphinx directory. There are a lot of configuration options. I am giving a brief idea on those,
- --prefix, which specifies where to install Sphinx; such as --prefix=/usr/local/sphinx (all of the examples use this prefix)
- --with-mysql, which specifies where to look for MySQL include and library files, if auto-detection fails.
- --with-pgsql, which specifies where to look for PostgreSQL include and library files.
You can follow those ideas on Sphinx Documentations.
-
Step 2. This step is basically a troubleshooting step. But its optional. If during configuration you see an error as, ERROR : Cannot find MySQL Include files, then you need to follow this step. I was also got the error. So I had to do some changes to my MySQL installation. This error is thrown just because sphinx searches for the default MySQL connector. Good news for us that the error shows what to do to solve the error. This error can be solved by installing the mysql-devel package. As I got the error the shell showed me this like the screenshot below.

So, to solve the error open up the terminal and then install mysql-devel.yum install mysql-devel

Then you will be presented with a new screen where you can see the package size and its dependencies.
-
Step 3. After mysql-devel installation, again configure the package. Then you will get the success screen as,
-
Step 4. Now, it is time to install the configured package. So to do that again open up the terminal and type,
make install
-
Step 5. After a lot of logging in the terminal screen you will see the success message that installation is completed successfully.

Open your file browser window and you will see after navigating to /usr/local, a new directory "sphinx" is created. That has the installed sphinx server.
-
Step 6. If you want to see the directory structure for sphinx then go on terminal, and type, "tree" command.
[root@localhost sphinx]# pwd /usr/local/sphinx [root@localhost sphinx]# tree . ├── bin │ ├── indexer │ ├── indextool │ ├── search │ ├── searchd │ └── spelldump ├── etc │ ├── example.sql │ ├── sphinx.conf.dist │ └── sphinx-min.conf.dist ├── share │ └── man │ └── man1 │ ├── indexer.1 │ ├── indextool.1 │ ├── search.1 │ ├── searchd.1 │ └── spelldump.1 └── var ├── data └── log 8 directories, 13 files [root@localhost sphinx]#
Comments
Thanks Very nicely explained tutorial
Submitted by Sajal (not verified) on
Thanks Very nicely explained tutorial
Add new comment