Installing sphinx search on linux CentOS 4.5

April 27, 2009

Trying to follow instructions on http://www.my-whiteboard.com/linux-admin/install-and-configure-sphinx-search-engine-for-wordpress-on-centos-redhat.html

 

Got sphinx 0.9.8 sources and tried to compile. But got error when doing make about mysql.h not found. Needed to install mysql-devel to resolve that error. After many hours of searching and trying, this is how I got it to install –

up2date –u mysql-devel

But this installed mysql-dev for mysql version 4.1, so make for sphinx resulted in compile errors. To install mysql 5.0 mysql-devel (the version of mysql I have), got the rpm from http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-devel-community-5.0.77-0.rhel4.i386.rpm/from/pick and installed it using rpm.

After this sphinx ./configure, make and make installed worked fine.

 

When I tried to run searchd, I got the error:

error while loading shared libraries: libexpat.so.1: cannot open shared object file: No such file or directory

Why can’t it find the library. Asked ldconfig –

ldconfig -p |grep expat

  libexpat.so.0 (libc6) => /usr/lib/libexpat.so.0

 

Okay, so ldconfig can’t find libexpat.so.1, but “locate libexpat.so.1” showed that it is in /usr/local/bin. That path was not in ldconfig’s configuration. So created new file /etc/ld.so.conf.d/usr-local.conf with the following text:

/usr/local/lib

 

Now “ldconfig -p |grep expat” shows –

libexpat.so.1 (libc6) => /usr/local/lib/libexpat.so.1
libexpat.so.0 (libc6) => /usr/lib/libexpat.so.0
libexpat.so (libc6) => /usr/local/lib/libexpat.so

 

searchd runs without errors, well with expected error –

Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff

FATAL: no readable config file (looked in /usr/local/etc/sphinx.conf, ./sphinx.conf).

Leave a comment