Tip: RedHat httpd RPM replacement
Hmph. I can't think of a word beginning with r- for Apache httpd.
When a couple of our servers were patched, it looks like the RedHat httpd took over for our /usr/local/ httpd. I didn't think the RPM was installed previously but I'm not sure, so I don't know whether the infamous They upgraded it during the patching or if they just installed it.
In any case, here's how to fix it:
To tell what httpd is running:
$ ps -ef | grep httpdIf the list of processes has /usr/sbin/httpd, it's the RPM version. Our local version will be something starting with /usr/local.
If the RPM version is running, become root and kill it:
# /etc/init.d/httpd stop(Optional) Blow away the httpd RPMs:
# rpm -qa | grep httpdThis command lists the RPMs installed; looks like there's three on this server now: httpd-2.2.15, httpd-tools-2.2.15, and httpd-manual-2.2.15. (Yay, doccies.)
# yum remove packageThe
comes from the rpm -qa
list above, and removing httpd removes httpd-manual (and some other packages as well) so I just had to remove httpd and httpd-tools.That'll teach 'em.
You will want to do this after you stop httpd and before you remove and re-create the /etc/init.d link because removing the RPM blows away the /etc/init.d link as well as stopping the server. Trying to use the
rpm
command rather thanyum
is possible (The command isrpm -e package
.), but it doesn't remove recursive dependencies, meaning it will require iteration.Remove the /etc/init.d/httpd script from the RPM and replace it with a link to the our version:
# rm /etc/init.d/httpd
# ln -s /usr/local/ours/httpd/bin/apachectl /etc/init.d/httpdYes, the startup script that comes with apache is called
apachectl
. If you removed the RPM in the previous step, you don't have to remove the init.d script here. If you didn't, you will probably have to go through this dance the next time They patch the servers.Start our httpd:
# /etc/init.d/httpd startThe ps command above should now show our httpd.
Here's to not having to look up rpm commands again.