Subject: Re: Starting Apache
From: Tak Ota <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Fri, 13 Jul 2001 15:54:55 -0700 (PDT)

I wonder if things written in this page are true.

  http://apache.dev.wapme.net/manual/cygwin.html#serv

/usr/doc/Cygwin/cygrunsrv.README mentions the caveat about running
daemon that forks.  httpd is such a daemon therefore it is not
possible to control httpd by -S and -E.  The direct child created by
cygrunsrv will not stay alive.

Even with this understanding there still is a fact that I cannot
explain its mechanism.  Though httpd quits from cygrunsrv point of
view the forked background child processes should continue to run
however this is not the case.  After service installation by

  cygrunsrv -I apache -p /usr/local/apache/bin/httpd

"cygrunsrv -S apache" does not leave any new processes.  Instead, it
produces the next error.

$ cygrunsrv -S apache
cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1062:
The service has not been started.

Next, I tried to run httpd as a normal process instead of a daemon.
Although it is not recommended httpd has an option -X for debugging
purpose to keep httpd running without forking.  I've tried the
following for installing the service.

  cygrunsrv -I apache -p /usr/local/apache/bin/httpd -a -X

Somehow this does not work either.  I get the same 1062 error.

There is another mysterious and unexplainable fact.  When I open two
Cygwin terminal windows and run /usr/local/apache/bin/httpd manually
from one of the terminal, it forks off the background process and
comes back to the bash prompt.  From both of the terminal windows,
'ps' shows the httpd processes running.  What is strange is if I close
the window which started the httpd, all those background process are
terminated.  "Running Apache for Cygwin" section of the document
states:

  If installed to the default Apache layout directory you can start
  httpd as follows:

    $ /usr/local/apache/bin/httpd

  An explicit background & indicator is not required. The resulting
  parent process is detached from the current terminal. Check the
  global error_log to see if Apache has started cleanly without any
  major problems.

However, the fact seems to be the spawned processes are still bound to
the terminal thus terminated when the terminal closes.

Does anyone have answer to the above mystery?

-Tak

On Thu, 12 Jul 2001 08:29:01 +0100, [email-masked] wrote:

> Am 11 Jul 2001, um 22:55 hat Tak Ota geschrieben:
> 
> Hi Tak,
> 
> > I just downloaded Apache 1.3.20.  It compiled/installed/ran out of the
> > box without any tweaking at all.  It was quite an impressive and
> > delightful experience.  Thank you.
> > 
> > BTW, I am now trying to automate the following work, in case I reboot
> > the machine.
> > 
> > /usr/local/apache/bin/apachectl start
> > 
> > What is the equivalent mechanism as /etc/rc.d/init.d/ under Cygwin?
> 
> Install it as a service with cygrunsrv:
> 	http://apache.dev.wapme.net/manual/cygwin.html#serv
> 
> gph
> 
> 
> -- 
> =^..^=
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/