Skip to content

Instantly share code, notes, and snippets.

@MDXDave

MDXDave/apache2 Secret

Created April 8, 2015 14:58
Show Gist options
  • Save MDXDave/13c367c20d89b162269e to your computer and use it in GitHub Desktop.
Save MDXDave/13c367c20d89b162269e to your computer and use it in GitHub Desktop.
Apache 2.4 Start-/Stop-Script
#!/bin/sh
### BEGIN INIT INFO
# Provides: apache2
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: apache2
# Description: httpd server for serving web content
### END INIT INFO
case "$1" in
start)
echo "Starting Apache ..."
/opt/apache2/bin/apachectl start
;;
stop)
echo "Stopping Apache ..."
/opt/apache2/bin/apachectl stop
;;
reload)
echo "Restarting Apache gracefully..."
/opt/apache2/bin/apachectl graceful
;;
restart)
echo "Restarting Apache ..."
/opt/apache2/bin/apachectl restart
;;
*)
echo "Usage: '$0' {start|stop|restart|reload}"
exit 64
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment