Wednesday, September 1, 2010

Apache HTTPD daemon script

#!/bin/bash
#
# /etc/rc.d/init.d/apached
# Startup script for the Apache web server
#
# chkconfig: - 85 15
# description: Start up the Apache web server.
# processname: apached
# pidfile: /var/run/apached.pid
# config:
#

# Source function library.
. /etc/init.d/functions


RETVAL=$?
APACHE_HOME="/usr/local/apache"

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

No comments:

Post a Comment