Apache HTTPd 2.4 on RPM based distributions

July 9th, 2012 | Categories: Linux, Networking, Technology

I previously mentioned rpmbuild. I wanted to write a little post on what it does and how useful it is. But I though it would be easier to just show you.

So what is rpmbuild? It is a tool for building rpm packages based on a spec file. The resulting rpm should be close to the rpm provided by your distribution. I’ve used rpmbuild on both Fedora and CentOS to create Apache HTTPd 2.4 binaries that works as a drop in replacement for the system ones.

So how does it work? I’ll just show you!

You need to install rpmbuild first.{{1}}

nara ~ # yum install rpm-build
nara ~ # useradd -m -c "rpmbuild user" rpmbuild

Download the apr, apr-util and httpd source code from apache.org.
Then simply run rpmbuild against the tar archive.{{2}}

nara ~ # sudo su - rpmbuild
rpmbuild@nara ~ $ rpmbuild -ta httpd-2.4.2.tar.bz2
rpmbuild@nara ~ $ sudo rpm -Uvh rpmbuild/RPMS/x86_64/httpd-2.4.2-1.x86_64.rpm

This is far from a step by step, but it should give you a general idea what rpmbuild does and how it can be used for building binaries on CentOS or another rpm based distribution.

Rpmbuild will point out which packages you are missing, just install them and you should be fine.
You may also experience an error on the new apr-util, if you do get the patch posted here.

[[1]]You should also install the development tools.[[1]]
[[2]]You need to start with apr, apr-util and work your way to httpd.[[2]]

Comments are closed.