Last active
January 19, 2018 09:16
-
-
Save note35/98d4f26ffc7a0eec0353 to your computer and use it in GitHub Desktop.
Cygwin
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
# 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