Skip to content

Instantly share code, notes, and snippets.

@note35
Last active January 19, 2018 09:16
Show Gist options
  • Select an option

  • Save note35/98d4f26ffc7a0eec0353 to your computer and use it in GitHub Desktop.

Select an option

Save note35/98d4f26ffc7a0eec0353 to your computer and use it in GitHub Desktop.

Revisions

  1. note35 revised this gist Jan 28, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion httpdctl.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Document: https://cygwin.rafaelhart.com/daemons/web-server-apache/
    # Updated: 2016/01/28
    # Install: cygserver, httpd
    # Install: cygrunsrv, httpd
    #
    # Please, run `cygserver-config` before run this script

  2. note35 created this gist Jan 28, 2016.
    29 changes: 29 additions & 0 deletions httpdctl.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    # Document: https://cygwin.rafaelhart.com/daemons/web-server-apache/
    # Updated: 2016/01/28
    # Install: cygserver, 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