So, on setting up a few new servers tonight for a client, I ran into the following error

[root@server ~]# rpm -e httpd httpd-suexec httpd-devel php php-pear php-devel php-imap
service httpd does not support chkconfig
error: %preun(httpd-2.0.52-32.3.ent.centos4.i386) scriptlet failed, exit status 1
[root@server ~]#

What happened here? This was a stock CentOS4 server (completely updated). How to resolve? Read more to find out.

in /etc/init.d/httpd (or /etc/rc.d/init.d/httpd) , on the second line, add

# chkconfig: 2345 10 90
# description: Activates/Deactivates Apache Web Server

This will force httpd to support chkconfig.

Now, you can run the following safely

[root@server ~]# rpm -e httpd httpd-suexec httpd-devel php php-pear php-devel php-imap

Unfortunately, you will need to reinstall your control panel (CPanel, DirectAdmin), as they don’t install correctly when they hit that error. If you don’t know how to do this, that’s quite simple.

Installing Cpanel:

wget http:// layer1.cpanel.net/cpanel-universal-install-v11.sea (take out the space after http://)
sh ./cpanel-universal-install-v11.sea

Then sit back and wait for the stuff to go on. It’ll take 1-2 hours to install CP, then you need to re-install rvskins and Fantastico if you have them
Fantastico

cd /usr/local/cpanel/whostmgr/docroot/cgi
wget -N http:// files.betaservant.com/files/free/fantastico_whm_admin.tgz (again, take out the space after http://)
tar -xzpf fantastico_whm_admin.tgz
rm -rf fantastico_whm_admin.tgz

Rvskin

mkdir /root/rvadmin;
cd /root/rvadmin;
wget http:// download.rvglobalsoft.com/download.php/download/rvskin-auto/saveto/rvauto.tar.bz2; (again, remove the space after http://)
bunzip2 -d rvauto.tar.bz2; tar -xvf rvauto.tar;
perl /root/rvadmin/auto_rvskin.pl

Now you’ve got cpanel re-installed properly. Hope that helps out

Installing Directadmin:

wget http:// www.directadmin.com/setup.sh (again, take out the space after http://)
chmod 755 setup.sh
sh ./setup.sh

Did this help you out? Hey, leave a comment and say so!