Installing Sphinx Search Server

I’ve always used MySQL fulltext indexes with a match query for keyword searches but I’ve never been happy with the results and lack of configuration choices. The limited nature of word interpretation and the boolean searches were useless when visitors didn’t know how to use search operators. Fulltext indexes require the MyISAM table structure – yet we generally prefer InnoDB because of performance and foreign key constraints.

For a recent project I decided to finally (long overdue, I know) make the the transition to an external search and indexing application called Sphinx.

(more…)

Installing MongoDB on CentOS 5

I’ve recently been exploring alternatives to SQL-based databases, primarily MongoDB.

MongoDB essentially stores records as JSON-encoded values and you interact with those records through the API rather than running any SQL. The following instructions are for getting mongodb installed on CentOS 5, along with the extension necessary for PHP support.

(more…)

Installing Memcached for PHP on CentOS 5

Memcached is a high performance cache system designed to improve the speed of web applications. A common example would be storing the results of database queries that can benefit from having a cache system in place.

Recently we had a web application that provided a long list of items formatted as an HTML ul element in response to an AJAX-style request. Our results and its formatting were the same for all users and they were also going to be called up frequently. We spent time ensuring the code and database structure were as optimized as possible before looking into a cache, but when you have a high ratio of accesses versus changes to the data, using a cache is very smart way to solve the problem.

(more…)

Correcting CGI Perl Module for Bugzilla 3.4.2

I was recently installing Bugzilla on a new server and ran into problems with the CGI perl module from CPAN being too recent. Apparently, version 3.47 has some issues, so I had to downgrade to 3.45.

Bugzilla recommends that you use their installer when the checksetup.pl script spits out missing modules. However, if you encounter problems or need older version, this won’t work.

However, their own script makes a copy of the CGI.pm file inside of the bugzilla libs/ directory.

In order to solve the issue, you need download and install the proper version, but then copy of the file to the bugzilla libs folder.


$ wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/CGI.pm-3.45.tar.gz
$ tar -xzvf CGI.pm-3.45.tar.gz
$ cd CGI*
$ perl Makefile.PL
$ make
$ make install
$ cp /usr/lib/perl5/5.8.8/CGI.pm /var/www/vhosts/trellisdev.com/subdomains/bugs/httpdocs/lib/CGI.pm

Then, continue with your checksetup.pl process as usual.

Bugzilla 3.4 localtime issue on CentOS

While recently upgrading and moving Bugzilla to 3.4.2 I ran into an issue on a CentOS 5 server that was giving the following error any time I tried to access a buglist:

undef error – Cannot determine local time zone

After some searching I finally discovered that the issue was with Bugzilla looking for the timezone information in /etc/localtime, while CentOS had not updated that file since it’s original installation.

The solution is to change /etc/localtime to a symlink that leads to the correct timezone file for you:

ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

Installing Git on Cent OS 5

It’s pretty straightforward to install Git on a mediatemple DV 3.0 server. If you have later versions of their servers with Yum installed, you may be able to simply install it through yum.

To begin you need to download the latest version and run through the standard extraction and configure/make/make install.

(more…)

Installing Lighttpd on CentOS 5

After dealing with some weird update issues trying to do this with a manually-download rpm file, I finally figured out that performing the following worked just fine:

# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# yum -y install lighttpd lighttpd-fastcgi mysql-server
# chkconfig --levels 235 lighttpd on
# /etc/init.d/lighttpd start

I did decide to change the port to 81 so that apache could still run on 80:


# vi /etc/lighttpd/lighttpd.conf