Sphinx 0.9.9 and IP.Board 3.1.x Installation Guide
ip.board 3.1.x sphinx 0.9.9 sphinx and ip.board installation guide
How To Guide and Setup Instructions
I've been asked a few times how to configure Sphinx 0.9.9 with the Invision Power Board 3.1.x release and associated applications so I thought I would write up a short installation guide. I will assume that you have root privileges and shell access to your machine for these instructions. If you do not you will need to contact your hosting provider to help you configure Sphinx.
There are docs located here for Sphinx 0.9.8 installation and troubleshooting.
Setting up Sphinx
The setup and configuration of Sphinx 0.9.9 is not very different from the above installation of 0.9.8. You can easily following along substituting in the newer version, but if you prefer here are the details.
Before you begin make sure that you have mysql-devel and mysql-libs installed on your system. If you do not you will need to install it for Sphinx to operate correctly. A common error for sphinx installed without the devel and libs packages is:
sphinx.h:54:19: error: mysql.h: No such file or directoryRHEL, CentOS, Fedora Users :
$ yum install mysql-devel
$ apt-get install mysql-devel
Sphinx can be downloaded from http://www.sphinxsearch.com/. Installing Sphinx is pretty straightforward. Following are the steps. --prefix defines the installation directory.
$ cd /home/me/src
$ wget http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz
$ tar -xzvf sphinx-0.9.9.tar.gz
$ cd sphinx-0.9.9
$ mkdir /usr/local/sphinx
$ ./configure --prefix /usr/local/sphinx --with-mysql
$ make install
RHEL, CentOS, Fedora Users:
$ yum install sphinx
$ apt-get install sphinx
CONFIGURE SPHINX IN YOUR BOARD ACP
From your System Tab > System Settings > System > Search Set-Up
Configure this page and take special care with the bottom three items: **SPHINX BASE PATH - Do not use the above setting unless this is actually where your searchd.log, query.log, and searchd.pid can be found** These items are configured either by the OS using YUM or APT-GET or when compiling the source using options. You will see that the base path is important because IP.Board uses this to configure your sphinx.conf file. If it is incorrect Sphinx will not work and you will see errors in sphinx.log
Once you have installed Sphinx you need to configure it so that it can access your database and be accessible from your scripts. Configuration files are normally found in the etc directory of the installion directory.
$ cd /usr/local/sphinx/etc
A default copy of sphinx.conf file we need to edit is called sphinx.conf.dist. This is where we will create the new sphinx.conf file that Invision Power writes for us.
Open your Board's Admin Control Panel and go here: System Tab > Under Applications and Modules Click "Manage Applications & Modules" > On the Apps and Modules Page click the link at the top to "Build Sphinx Conf" > When the file download window appears either open it using notepad or save the file to your desktop and then open it using notepad. Once the file is open use the file menu to "select all" and "copy" the contents to your clipboard.
Locate sphinx.conf.dist. and navigate to that directory. Then create a new file using
$ vi sphinx.conf
Press the [INSERT] key on your keyboard to begin editing.
Right click will paste your clipboard saved content into the file if you are using Putty or Shell
Press the [ESC] key to stop editing.
Type :wq + [ENTER] to write and quit out of vi.
START (RESTART) SEARCHD
# service searchd restart
RUN THE INDEXER
# /usr/local/bin/indexer --config /path/to/sphinx.conf --all --rotate
CREATE A CRON JOB
# crontab -e
*/15 * * * * /usr/local/bin/indexer --config /path/to/sphinx.conf core_search_delta members_search_delta forums_search_posts_delta calendar_search_delta downloads_search_delta blog_search_delta gallery_search_delta gallery_search_comments_delta --rotate
0 4 * * * /usr/local/bin/indexer --config /path/to/sphinx.conf --all --rotate
CONFIGURE SEARCHD TO START ON STARTUP
In SERVICES select "searchd" to autostart