Skip to content

Instantly share code, notes, and snippets.

@sondr3
Created August 7, 2013 05:55
Show Gist options
  • Save sondr3/6171581 to your computer and use it in GitHub Desktop.
Save sondr3/6171581 to your computer and use it in GitHub Desktop.
Apache 2.4 init.d script for Debian 7
#!/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 ..."
# Change the location to your specific location
/usr/local/apache2/bin/apachectl start
;;
stop)
echo "Stopping Apache ..."
# Change the location to your specific location
/usr/local/apache2/bin/apachectl stop
;;
graceful)
echo "Restarting Apache gracefully..."
# Change the location to your specific location
/usr/local/apache2/bin/apachectl graceful
;;
restart)
echo "Restarting Apache ..."
# Change the location to your specific location
/usr/local/apache2/bin/apachectl restart
;;
*)
echo "Usage: '$0' {start|stop|restart|graceful}"
exit 64
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment