Skip to content

Instantly share code, notes, and snippets.

@tkyowa
Created February 22, 2012 02:07
Show Gist options
  • Save tkyowa/1880648 to your computer and use it in GitHub Desktop.
Save tkyowa/1880648 to your computer and use it in GitHub Desktop.
Simple initscript for Apache
#!/bin/sh
#
# Simple startup script for Apache
#
# chkconfig: 345 85 15
# description: Apache
# processname: httpd
#
. /etc/init.d/functions
SERVER_ROOT=/etc/apache.d/
OPTARGS="-d ${SERVER_ROOT}"
PROG=/etc/init.d/apache
HTTPD=/usr/local/apache2/bin/httpd
RETVAL=0
case "$1" in
start|stop|restart|graceful|graceful-stop)
echo "$1 httpd ... "
${HTTPD} -k $1 ${OPTARGS}
RETVAL=$?
echo "done."
;;
configtest)
${HTTPD} -t ${OPTARGS}
RETVAL=$?
;;
modules)
${HTTPD} -M ${OPTARGS}
RETVAL=$?
;;
*)
echo "Usage: ${PROG} {start|stop|restart|graceful|graceful-stop|configtest|modules}"
exit 1
esac
exit ${RETVAL}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment