It's not possible to augment the options a tool was complied with so you're left to re-compile it yourself if you need additional options added in. With a package like httpd (Apache) on a RedHat based distro this isn't too bad.
You'll essentially need 3 things to do this:
- dependencies installed for httpd
- source RPM version of httpd
- an rpmbuild area
dependencies
You can use the tool yum-builddep to help in the effort. This tool will download all the packages required to build & install a given RPM. So you'll need to get yourself a version of the httpd RPM. But make sure to get it's source version typically named src.rpm files. For example:
mypackage-1.0.0-1.src.rpm
source RPM
For CentOS 6.2 you could download this source RPM:
- http://vault.centos.org/6.2/os/Source/SPackages/httpd-2.2.15-15.el6.centos.src.rpm
build environment
I typically use a tool to set this up for me, rpmdev-setuptree.
$ yum install rpmdevtools
$ rpmdev-setuptree
Now change directories to your newly built rpmbuild area, and install the source RPM so that we can begin to modify how it get's built:
$ cd ~/rpm
$ rpm -ivh httpd-2.2.15-15.el6.centos.src.rpm
How we need to edit the httpd.spec file. This is the file that details how the eventual binary RPM should be constructed:
$ nano SPEC/httpd.spec
You'll need to find a section in this file where configure is being invoked. I usually search for the string --prefix. This next step is where you can add your modifications which will change how suexec get's built.
excerpt of configure stanza from httpd.spec
../configure \
--prefix=%{_sysconfdir}/httpd \
--exec-prefix=%{_prefix} \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--sysconfdir=%{_sysconfdir}/httpd/conf \
--includedir=%{_includedir}/httpd \
--libexecdir=%{_libdir}/httpd/modules \
--datadir=%{contentdir} \
--with-installbuilddir=%{_libdir}/httpd/build \
--with-mpm=$mpm \
--with-apr=%{_prefix} --with-apr-util=%{_prefix} \
--enable-suexec --with-suexec \
--with-suexec-caller=%{suexec_caller} \
--with-suexec-docroot=%{contentdir} \
--with-suexec-logfile=%{_localstatedir}/log/httpd/suexec.log \
--with-suexec-bin=%{_sbindir}/suexec \
--with-suexec-uidmin=500 --with-suexec-gidmin=100 \
--enable-pie \
--with-pcre \
$*
Save the file and now you're ready to build your version of httpd.
building source RPM
The following command will build your RPM:
$ rpmbuild -ba SPEC/httpd.spec
If all goes correctly you should be left with a new version of the RPM in the RPM directory here: RPM/httpd-2.2.15-15.el6.centos.x86_64.rpm.
Now you can install it like any other normal RPM.
References