Apache Startup Script

The CentOS startup script for apache is located at /etc/init.d/httpd. I backed this file up to /home/lasota/saved/httpd_d/httpd and replaced it with:

#!/bin/bash
#
# apache
#
# chkconfig:
# description: Start up the Apache web server.
# Source function library.
. /etc/init.d/functions
RETVAL=$?
APACHE_HOME=”/usr/local/apache2/”
case “$1″ in
start)
if [ -f $APACHE_HOME/bin/apachectl ]; then
echo $”Starting Apache”
$APACHE_HOME/bin/apachectl start
fi
;;
stop)
if [ -f $APACHE_HOME/bin/apachectl ]; then
echo $”Stopping Apache”
$APACHE_HOME/bin/apachectl stop
fi
;;
*)
echo $”Usage: $0 {start|stop}”
exit 1
;;
esac
exit $RETVAL

This script functions and starts the proper apache (the one I compiled from source). Question: does it survive a yum reinstall?

The startup script above does survive a

yum reinstall httpd

I wonder if some other yum update or reinstall would clobber the startup script though. I will ask Peter.