Created
February 22, 2012 02:07
-
-
Save tkyowa/1880648 to your computer and use it in GitHub Desktop.
Simple initscript for Apache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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