Skip to content

Instantly share code, notes, and snippets.

@note35
Last active January 19, 2018 09:16
Show Gist options
  • Save note35/98d4f26ffc7a0eec0353 to your computer and use it in GitHub Desktop.
Save note35/98d4f26ffc7a0eec0353 to your computer and use it in GitHub Desktop.
Cygwin
# Document: https://cygwin.rafaelhart.com/daemons/web-server-apache/
# Updated: 2016/01/28
# Install: cygrunsrv, httpd
#
# Please, run `cygserver-config` before run this script
usage ()
{
echo 'Usage : httpdctl <start|restart|stop>'
exit
}
if [ -z "$1" ]; then
usage
else
if [ $1 == 'restart' ]; then
cygrunsrv --remove httpd
sleep 2
cygrunsrv -I httpd -d "CYGWIN httpd" -p /usr/sbin/httpd -a "-DNO_DETACH" -y cygserver -e "CYGWIN=server" -s TERM -o
cygrunsrv --start httpd
elif [ $1 == 'stop' ]; then
cygrunsrv --remove httpd
elif [ $1 == 'start' ]; then
cygrunsrv -I httpd -d "CYGWIN httpd" -p /usr/sbin/httpd -a "-DNO_DETACH" -y cygserver -e "CYGWIN=server" -s TERM -o
cygrunsrv --start httpd
else
usage
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment