Jo Rhett (jorhett) wrote,
Jo Rhett

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

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
This has been cut for brevity to my livejournal friends. You can read the entire article at
Tags: apache, geekery, httpd, patch, rpmbuild

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded