Howto build Apache 2.4 for CentOS 6 or RHEL6 (patch)

By on January 9, 2013 - Geekery Tags: , , ,

Apache has started including a specfile in their builds, such that you should be able to just invoke rpmbuild against it. If you’ve tried it, you’ve probably bumped into a distcache dependency.

$ rpmbuild -tb httpd-2.4.3.tar.bz2 
error: Failed build dependencies:
	distcache-devel is needed by httpd-2.4.3-1.x86_64

If you google around you’ll notice that there’s no distcache library easily available for EL6 systems. If you solve that problem, you’ll slam into a very weird dependency problem with an undefined/unused Epoch in the specfile.

ERROR with rpm_check_debug vs depsolve:
httpd = %{epoch}:2.4.3-1 is needed by mod_ssl-2.4.3-1.x86_64
httpd = %{epoch}:2.4.3-1 is needed by httpd-devel-2.4.3-1.x86_64

I’ve created a patch for httpd on rhel6 / centos 6 systems. It disables the (totally unnecessary) socache_distcache plugin, and fixes the use of the undefined epoch in the specfile. Apply it like this:

$ tar xjf httpd-2.4.3.tar.bz2 
$ patch -p0 < httpd-2.4.3.rhel6.patch
$ tar cjf httpd-2.4.3.rhel6.tbz2 httpd-2.4.3
$ rpmbuild -tb httpd-2.4.3.rhel6.tbz2