You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Andrew Braund <ab...@mail.com> on 2000/07/07 10:52:12 UTC

RE: [patch 1.3.13-dev] Win9x Services

1.3.13-dev testing on Win2000;

Summary; A couple of minor issues.


Details;
Compiled using CVS snapshot apache-1.3_20000706221200.tar.gz

Testing on Win 2000 5.00.2195;


  C:\ServerRoot>apache -v
  Server version: Apache/1.3.13-dev-apache-1.3_20000706221200.tar.gz (Win32)
  Server built:   Jul  7 2000 10:47:57
  Note the errors or messages above, and press the <ESC> key to exit.  26...
  C:\ServerRoot>

With no http.conf;
When run as shortcut on start menu (c:\serverroot\apache), a dos window pops
up with;
  [Fri Jul 07 11:52:07 2000] [warn] Registry does not contain key SOFTWARE\
  ApaGroup\Apache\1.3.13-dev-apache-1.3_20000706221200.tar.gz
  fopen: No such file or directory
  Apache.exe: could not open document config file /apache/conf/httpd.conf
  Note the errors or messages above, and press the <ESC> key to exit.  23...

and 30 seconds later the dos window disappears (also disappears if you hit
esc).


***************
Apache does not remove the PID file, so next time you try it gives the
unclean shutdown message;
***************

Followed the instructions in C:\apache-1.3\htdocs\manual\win_compiling.html

The documentation says;
copy ..\conf\*.conf-dist-win c:\ServerRoot\conf\*.conf
copy ..\conf\magic c:\ServerRoot\conf\
copy ..\conf\mime.types c:\ServerRoot\conf\
copy ..\htdocs\*.* c:\ServerRoot\htdocs\ /s

the last line is wrong, must use xcopy for recursive ie change to;
xcopy ..\htdocs\*.* c:\ServerRoot\htdocs\ /s

Edited http.conf as per documentation then ran apache;

  C:\ServerRoot>apache
  [Fri Jul 07 13:54:14 2000] [alert] apache: Missing ServerName directive,
assumed
  host name 127.0.0.1

  Apache/1.3.13-dev-apache-1.3_20000706221200.tar.gz (Win32) running...

edited http.conf to add;
ServerName 192.168.0.60


  C:\ServerRoot>apache
  Apache/1.3.13-dev-apache-1.3_20000706221200.tar.gz (Win32) running...


Now edited http.conf to add the modules I use;
mod_status.c, mod_info.c, mod_rewrite.c, mod_proxy.c enabled,
php-4.0.1pl2-Win32 PHP as external script processor.


apache
  left click in window now has no effect, ctrl+c always stops Apache,
  closing the window stops Apache cleanly.
  if you want to copy from the window then Menu Edit:Mark then Enter works

apache -i
  installs default Apache service
  Win2k dependencies tab in properties for  service
  does not show Apache to be dependent upon anything (even when started).
apache -k start
  runs console
apache -n apache -k start
  runs as service
apache -u
  stops and removes the service
apache -k stop
apache -i -n "apache web server"
apache -i -n "apache web server" -f "\myserver\conf\http.conf"
apache -u -n "apache web server"
apache -n "apache web server" -t
apache -n "apache web server" -T
apache -n "apache web server" -l
apache -n "apache web server"
apache -n "apache web server" -k start
apache -n "apache web server" -k restart
if there is an syntax error in the httpd.conf file, a restart will
give an appropriate error message and leave the existing server running.
eg;
  C:\ServerRoot>apache -n "apache web server" -k restart
  Syntax error on line 289 of c:/serverroot/conf/httpd.conf:
  Invalid command 'DocumentdRoot', perhaps mis-spelled or defined by a
module
  not included in the server configuration
  Note the errors or messages above, and press the <ESC> key to exit.  22...

If its just missing the host name you get a warning but the server
restarts OK eg;
  C:\ServerRoot>apache -n "apache web server" -k restart
  [Fri Jul 07 17:24:11 2000] [alert] apache: Missing ServerName directive,
  assumed host name 127.0.0.1

  The apache web server service is restarting.
  The apache web server service has restarted.

apache -n "apache web server" -k restart
  (when apache was stopped will start it)
apache -n "apache web server" -k shutdown
apache -n "apache web server" -k stop
NET START "apache web server"
NET STOP "apache web server"
start and stop from control panel service applet

All of the above worked correctly (served pages, status, info, PHP and
proxy).

WR wrote;
>Just added two last features.  One holds the console
>window open if Apache dies with an error.  The second
>logs every NT/2000 service error message to the Application
>Event Log.

In all the above testing nothing had been written to the event log.

I tried a bit harder...

Edited httpd.conf to introduce an error, then;
NET START "apache web server"
Application log got two entries;
  The Apache service named apachewebserver reported the following error:
  >>> Syntax error on line 266 of c:/serverroot/conf/httpd.conf: <<<
  before the error.log file could be opened.
  More information may be available in the error.log file.   .

  The Apache service named apachewebserver reported the following error:
  >>> Invalid command 'ServerAdXmin', perhaps mis-spelled or defined by a
  module not included in the server configuration <<<
  before the error.log file could be opened.
  More information may be available in the error.log file.  .

apache -n "apache web server" -k restart
does not give any event log entries, just messages on the console.

Regards
Andrew Braund


RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
> > > > > The above is an interesting -side effect-, not an 
> > > intended behavior.
> > > > > I don't see a reason to make any special provision, however.
> > > > 
> > > > I like this behaviour, only ever need to give the restart 
> > > command, Apache
> > > > will start if stopped, or restart if already going. Pity 
> > > Win95 doesn't
> > > > do the same, but thats OK.
> > > 
> > > The good news is that this is also the correct behavior.  
> :-)  This is
> > > exactly what Apache does on Unix, so this should be left alone.
> > 
> > Then I would argue that we should report an
> > 
> >    [error] service not started
> > 
> > and do the same in NT, leaving 9x alone :-)
> 
> 
> All platforms should start if the restart command is given, 
> regardless of
> whether they are currently running or not.  There is no reason to not
> start just because it isn't currently running.

Once again I read you backwards...  I _will_ assure that Win9x starts
when passed the -k restart tag.  (Ya know... maybe this is why my English 
teachers always warned me about double negatives :-)

RE: [patch 1.3.13-dev] Win9x Services

Posted by rb...@covalent.net.
> > > > The above is an interesting -side effect-, not an 
> > intended behavior.
> > > > I don't see a reason to make any special provision, however.
> > > 
> > > I like this behaviour, only ever need to give the restart 
> > command, Apache
> > > will start if stopped, or restart if already going. Pity 
> > Win95 doesn't
> > > do the same, but thats OK.
> > 
> > The good news is that this is also the correct behavior.  :-)  This is
> > exactly what Apache does on Unix, so this should be left alone.
> 
> Then I would argue that we should report an
> 
>    [error] service not started
> 
> and do the same in NT, leaving 9x alone :-)


All platforms should start if the restart command is given, regardless of
whether they are currently running or not.  There is no reason to not
start just because it isn't currently running.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
> From: rbb@covalent.net [mailto:rbb@covalent.net]
> Sent: Sunday, June 11, 2000 10:31 PM
> 
> > > > apache -n "apsvc" -k restart
> > > >   (when apache was stopped will start it)
> > >
> > > The above is an interesting -side effect-, not an 
> intended behavior.
> > > I don't see a reason to make any special provision, however.
> > 
> > I like this behaviour, only ever need to give the restart 
> command, Apache
> > will start if stopped, or restart if already going. Pity 
> Win95 doesn't
> > do the same, but thats OK.
> 
> The good news is that this is also the correct behavior.  :-)  This is
> exactly what Apache does on Unix, so this should be left alone.

Then I would argue that we should report an

   [error] service not started

and do the same in NT, leaving 9x alone :-)


RE: [patch 1.3.13-dev] Win9x Services

Posted by rb...@covalent.net.

> > > apache -n "apsvc" -k restart
> > >   (when apache was stopped will start it)
> >
> > The above is an interesting -side effect-, not an intended behavior.
> > I don't see a reason to make any special provision, however.
> 
> I like this behaviour, only ever need to give the restart command, Apache
> will start if stopped, or restart if already going. Pity Win95 doesn't
> do the same, but thats OK.

The good news is that this is also the correct behavior.  :-)  This is
exactly what Apache does on Unix, so this should be left alone.

Ryan



RE: [patch 1.3.13-dev] Win9x Services

Posted by Andrew Braund <ab...@mail.com>.
> -----Original Message-----
> From: William A. Rowe, Jr. [mailto:wrowe@lnd.com]
> Sent: Sunday, 11 June 2000 11:48
> To: new-httpd@apache.org
> Subject: RE: [patch 1.3.13-dev] Win9x Services
>
>
> A few of these things concern me... let's dig inline...
>
> But I've knocked off every
>
>  apache -k runservice
>
> It's dead - this is expected.
>
> See the latest set of windows.html, win_service, win_compiling
> for what is probably my last set of edits to 1.3.13-dev.
>
>
> > From: Andrew Braund [mailto:abraund_news@mail.com]
> > Sent: Saturday, June 10, 2000 7:34 PM
> >
> > More testing on windows;
> >
> > Summary; 1.3.13 ROCKS
>
> Good to hear.
>
> > Details;
> >
> > Some more testing on WinNT4, Win2000, Win95, Win98;
> >
> > Compiled with http_main.c service.h and service.c from the web cvs
> > 20000610 2pm +930.
> >
> > mod_status.c, mod_info.c, mod_rewrite.c, mod_proxy.c enabled,
> > PHP as external script processor.
> >
> > Testing on Win NT4 SP6a;
> >
> > apache -v
> > Server version: Apache/1.3.13-dev-cvs 20000610140000 (Win32)
> > Server built:   Jun 10 2000 14:28:17
> >
> > apache
> > apache -i
> >   installs default Apache service
> > apache -k start
> >   runs console
> > apache -n apache -k start
> >   runs as service
> > apache -u
> > apache -k stop
> > apache -i -n "apsvc"
> > apache -i -n "apsvc" -f "\my server\conf\my.conf"
> > apache -u -n "apsvc"
> > apache -n "apsvc" -t
> > apache -n "apsvc"
> > apache -n "apsvc" -k start
> > apache -n "apsvc" -k restart
> >   (when apache was stopped will start it)
>
> The above is an interesting -side effect-, not an intended behavior.
> I don't see a reason to make any special provision, however.

I like this behaviour, only ever need to give the restart command, Apache
will start if stopped, or restart if already going. Pity Win95 doesn't
do the same, but thats OK.

>
> > apache -n "apsvc" -k shutdown
> > apache -n "apsvc" -k stop
> > NET START "apsvc"
> > NET STOP "apsvc"
> > start and stop from control panel service applet
> >
> > All of the above worked correctly (served pages, status,
> > info, PHP and proxy).
> >
> >
> > Testing on Win 2000 5.00.2195;
> >
> > apache -v
> > Server version: Apache/1.3.13-dev-service9x.200006091127 (Win32)
> > Server built:   Jun 10 2000 13:26:09
> >
> > apache
> >   First impression was that Ctrl-C does not seem to to shutdown
> >   Apache, apache -k stop in another dos window closes it down
> >   quickly. Further testing revealed that this was due to the new
> >   way the command prompt window works, it has a select mode and an edit
> >   mode, unless you are in edit mode apache does not get the Ctrl-C.
>
> I don't like this, can someone with VC, 2000 and a little experience with
> SetConsoleControlHandler play with this?  I'm expecting that SetConsoleMode
> is a little different, perhaps they have changed defaults...  I am seriously
> convinced that the console mode support has been frequently changed by M$
> to seriously cripple console apps on Win32.
>
> > apache -i
> >   installs default Apache service
> >   Win2k has a dependencies tab in properties for a service but it
> >   does not show Apache to be dependent upon anything (even when started).
>
> I don't like... can you review the registry under the key
>
> HKLM\system\currentcontrolset\services\apache for the depends keys?
>
> I'm suspecting that the tab reflects dependency 'groups', as opposed
> to individual dependent apps.

Win2000;
apache -i
creates the following; (using regedit)

===============================================================================
=====
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):22,00,43,00,3a,00,5c,00,53,00,65,00,72,00,76,00,65,00,72,00,
\
  52,00,6f,00,6f,00,74,00,5c,00,41,00,70,00,61,00,63,00,68,00,65,00,2e,00,65,\
  00,78,00,65,00,22,00,00,00
"DisplayName"="Apache"
"DependOnService"=hex(7):54,00,63,00,70,00,69,00,70,00,00,00,41,00,66,00,64,00,
\
  00,00,00,00
"DependOnGroup"=hex(7):00,00
"ObjectName"="LocalSystem"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache\Parameters]
"ConfPath"="c:/serverroot/conf/httpd.conf"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache\Security]
"Security"=hex:01,00,14,80,a0,00,00,00,ac,00,00,00,14,00,00,00,30,00,00,00,02,\
  00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
  00,00,02,00,70,00,04,00,00,00,00,00,18,00,fd,01,02,00,01,01,00,00,00,00,00,\
  05,12,00,00,00,65,00,72,00,00,00,1c,00,ff,01,0f,00,01,02,00,00,00,00,00,05,\
  20,00,00,00,20,02,00,00,76,00,65,00,00,00,18,00,8d,01,02,00,01,01,00,00,00,\
  00,00,05,0b,00,00,00,20,02,00,00,00,00,1c,00,fd,01,02,00,01,02,00,00,00,00,\
  00,05,20,00,00,00,23,02,00,00,76,00,65,00,01,01,00,00,00,00,00,05,12,00,00,\
  00,01,01,00,00,00,00,00,05,12,00,00,00
===============================================================================
=====

or from regedt32;

===============================================================================
=====
Key Name:          SYSTEM\CurrentControlSet\Services\Apache
Class Name:        <NO CLASS>
Last Write Time:   12/06/2000 - 10:12 AM
Value 0
  Name:            DependOnGroup
  Type:            REG_MULTI_SZ
  Data:

Value 1
  Name:            DependOnService
  Type:            REG_MULTI_SZ
  Data:            Tcpip
                   Afd


Value 2
  Name:            DisplayName
  Type:            REG_SZ
  Data:            Apache

Value 3
  Name:            ErrorControl
  Type:            REG_DWORD
  Data:            0x1

Value 4
  Name:            ImagePath
  Type:            REG_EXPAND_SZ
  Data:            "C:\ServerRoot\Apache.exe"

Value 5
  Name:            ObjectName
  Type:            REG_SZ
  Data:            LocalSystem

Value 6
  Name:            Start
  Type:            REG_DWORD
  Data:            0x2

Value 7
  Name:            Type
  Type:            REG_DWORD
  Data:            0x10


Key Name:          SYSTEM\CurrentControlSet\Services\Apache\Enum
Class Name:        <NO CLASS>
Last Write Time:   12/06/2000 - 10:17 AM
Value 0
  Name:            0
  Type:            REG_SZ
  Data:            Root\LEGACY_APACHE\0000

Value 1
  Name:            Count
  Type:            REG_DWORD
  Data:            0x1

Value 2
  Name:            NextInstance
  Type:            REG_DWORD
  Data:            0x1


Key Name:          SYSTEM\CurrentControlSet\Services\Apache\Parameters
Class Name:        <NO CLASS>
Last Write Time:   12/06/2000 - 10:12 AM
Value 0
  Name:            ConfPath
  Type:            REG_SZ
  Data:            c:/serverroot/conf/httpd.conf


Key Name:          SYSTEM\CurrentControlSet\Services\Apache\Security
Class Name:        <NO CLASS>
Last Write Time:   12/06/2000 - 10:12 AM
Value 0
  Name:            Security
  Type:            REG_BINARY
  Data:
00000000   01 00 14 80 a0 00 00 00 - ac 00 00 00 14 00 00 00  .... ...¬.......
00000010   30 00 00 00 02 00 1c 00 - 01 00 00 00 02 80 14 00  0...............
00000020   ff 01 0f 00 01 01 00 00 - 00 00 00 01 00 00 00 00  ÿ...............
00000030   02 00 70 00 04 00 00 00 - 00 00 18 00 fd 01 02 00  ..p.........ý...
00000040   01 01 00 00 00 00 00 05 - 12 00 00 00 65 00 72 00  ............e.r.
00000050   00 00 1c 00 ff 01 0f 00 - 01 02 00 00 00 00 00 05  ....ÿ...........
00000060   20 00 00 00 20 02 00 00 - 76 00 65 00 00 00 18 00   ... ...v.e.....
00000070   8d 01 02 00 01 01 00 00 - 00 00 00 05 0b 00 00 00  ................
00000080   20 02 00 00 00 00 1c 00 - fd 01 02 00 01 02 00 00   .......ý.......
00000090   00 00 00 05 20 00 00 00 - 23 02 00 00 76 00 65 00  .... ...#...v.e.
000000a0   01 01 00 00 00 00 00 05 - 12 00 00 00 01 01 00 00  ................
000000b0   00 00 00 05 12 00 00 00 -                          ........
===============================================================================
=====

Dependencies tab for Apache showed no dependancies.
I then added Tcpip and Afd to DependOnGroup
so regedit export was now

===============================================================================
=====
Key Name:          SYSTEM\CurrentControlSet\Services\Apache
Class Name:        <NO CLASS>
Last Write Time:   12/06/2000 - 10:26 AM
Value 0
  Name:            DependOnGroup
  Type:            REG_MULTI_SZ
  Data:            Tcpip
                   Afd


Value 1
  Name:            DependOnService
  Type:            REG_MULTI_SZ
  Data:            Tcpip
                   Afd


Value 2
  Name:            DisplayName
  Type:            REG_SZ
  Data:            Apache

Value 3
  Name:            ErrorControl
  Type:            REG_DWORD
  Data:            0x1

Value 4
  Name:            ImagePath
  Type:            REG_EXPAND_SZ
  Data:            "C:\ServerRoot\Apache.exe"

Value 5
  Name:            ObjectName
  Type:            REG_SZ
  Data:            LocalSystem

Value 6
  Name:            Start
  Type:            REG_DWORD
  Data:            0x2

Value 7
  Name:            Type
  Type:            REG_DWORD
  Data:            0x10


Key Name:          SYSTEM\CurrentControlSet\Services\Apache\Enum
Class Name:        <NO CLASS>
Last Write Time:   12/06/2000 - 10:17 AM
Value 0
  Name:            0
  Type:            REG_SZ
  Data:            Root\LEGACY_APACHE\0000

Value 1
  Name:            Count
  Type:            REG_DWORD
  Data:            0x1

Value 2
  Name:            NextInstance
  Type:            REG_DWORD
  Data:            0x1


Key Name:          SYSTEM\CurrentControlSet\Services\Apache\Parameters
Class Name:        <NO CLASS>
Last Write Time:   12/06/2000 - 10:12 AM
Value 0
  Name:            ConfPath
  Type:            REG_SZ
  Data:            c:/serverroot/conf/httpd.conf


Key Name:          SYSTEM\CurrentControlSet\Services\Apache\Security
Class Name:        <NO CLASS>
Last Write Time:   12/06/2000 - 10:12 AM
Value 0
  Name:            Security
  Type:            REG_BINARY
  Data:
00000000   01 00 14 80 a0 00 00 00 - ac 00 00 00 14 00 00 00  .... ...¬.......
00000010   30 00 00 00 02 00 1c 00 - 01 00 00 00 02 80 14 00  0...............
00000020   ff 01 0f 00 01 01 00 00 - 00 00 00 01 00 00 00 00  ÿ...............
00000030   02 00 70 00 04 00 00 00 - 00 00 18 00 fd 01 02 00  ..p.........ý...
00000040   01 01 00 00 00 00 00 05 - 12 00 00 00 65 00 72 00  ............e.r.
00000050   00 00 1c 00 ff 01 0f 00 - 01 02 00 00 00 00 00 05  ....ÿ...........
00000060   20 00 00 00 20 02 00 00 - 76 00 65 00 00 00 18 00   ... ...v.e.....
00000070   8d 01 02 00 01 01 00 00 - 00 00 00 05 0b 00 00 00  ................
00000080   20 02 00 00 00 00 1c 00 - fd 01 02 00 01 02 00 00   .......ý.......
00000090   00 00 00 05 20 00 00 00 - 23 02 00 00 76 00 65 00  .... ...#...v.e.
000000a0   01 01 00 00 00 00 00 05 - 12 00 00 00 01 01 00 00  ................
000000b0   00 00 00 05 12 00 00 00 -                          ........
===============================================================================
=====

but Dependencies tab for Apache still showed no dependancies.

Looking at Tcpip and afd entries I see that;
Tcpip group is PNP_TDI
AFD group is TDI

It seems to me that dependancies are only shown when the service depends
on another "real" service ie something that appears an an entry when you
display the services on a machine.
Dependancies are also shown when you use a group name.
e.g. if I add lanmanworkstation as a DependsOnService entry in apache, then the
"Apache depends on these services" box in Dependencies tab of Apache service
shows "Workstation" (which is the DisplayName entry for lanmanworkstation),
when I add tcpip the "Apache depends on these services" box in Dependencies tab
of Apache service shows nothing.
Also if I add DependsOnService entry of rpcss to Apache then Remote Procedure
Call (RPC) shows up in the Apache depends on tab.
Adding PNP_TDI and TDI to DependsOnGroup entry of Apache shows PNT_TDI and TDI
in the "Apache depends on these services" box in Dependencies tab of Apache
service.




BTW apache -u removes the whole apache tree (including the
 depend on group entries I added), this is good.

>
> > apache -k start
> >   runs console
> > apache -n apache -k start
> >   runs as service
> > apache -u
> > apache -k stop
> >
> > apache -i -n "apache web server"
> > apache -i -n "apache web server" -f "\my server\conf\my.conf"
> > apache -u -n "apache web server"
> > apache -n "apache web server" -t
> > apache -n "apache web server"
> > apache -n "apache web server" -k start
> > apache -n "apache web server" -k restart
> >   if there is an syntax error in the httpd.conf file, a restart will
> >   give an appropriate error message and leave the existing server running.
>
> This might be the best behavior... at least they don't kill the server
> permanantly, and can keep it running till the error is corrected.

I think this is good.

>
> > apache -n "apache web server" -k restart
> >   (when apache was stopped will start it)
>
> again, a side-effect
>
> > apache -n "apache web server" -k shutdown
> > apache -n "apache web server" -k stop
> > NET START "apache web server"
> > NET STOP "apache web server"
> > start and stop from control panel service applet
> >
> > All of the above worked correctly (served pages, status,
> > info, PHP and proxy).
> >
> >
> > Testing on Windows 95 4.00.950;
> >
> > apache
> > apache -i
> > apache -i
> >   with an error in the httpd.conf file gives descriptive
> > error message.
> > apache -k start
> >   runs console
> > apache -n apac -k start
> >   [Sun Jun 11 09:17:45 2000] [error] Service "apac" is not installed!
> >
> > apache -n apache -k start
> > apache -n apache -k restart
> > apache -k shutdown
> > apache -k restart
> >   when stoped;
> >   Cannot read apache PID file c:/serverroot/logs/httpd.pid
> >   and apache does not start.
>
> This is actually the anticipated behavior.  Nothing in the restart
> syntax is ment to imply that restart starts the server if it is
> not yet running.

I start and stop Apache from another program. If Apache were to
- start when not running
- restart when running
when issued
 -k restart
it would make my control very simple, but I can live with it either way.

>
> > apache -k stop
> > apache -u
> >   if already uninstalled gives;
> >   [Sun Jun 11 08:20:34 2000] [error] Service "Apache" is not
> > installed!
> >
> > Windows shuts down normally even when Apache is running in
> > the background.
> >
> > All of the above worked correctly (served pages, status,
> > info, PHP and proxy).
> >
> >
> > Testing on Windows 98 4.10.1998; (two different boxes)
> >
> > apache
> > apache -i
> > apache -i
> >   when already installed gives;
> >   [Sun Jun 11 09:43:25 2000] [error] Service "Apache" is
> > already installed!
> >
> > apache -k runservice
> >   Cannot read apache PID file c:/serverroot/logs/httpd.pid
> > apache -k start
> >   runs console
> > apache -n apache -k start
> > apache -k shutdown
> > apache -k stop
> > Windows shuts down normally even when Apache is running in
> > the background.
> > All of the above worked correctly (served pages, status,
> > info, PHP and proxy
> > including CONNECT).
> >
> > apache -u
> > apache -u
> >   if already uninstalled gives;
> >   [Sun Jun 11 09:48:38 2000] [error] Service "Apache" is not
> > installed!
> >
> > Windows shuts down normally even when Apache is running in
> > the background.
> >
> >
> > Regards
> > Andrew Braund
>
> And a warm thank you to yourself, for all you efforts testing these fixes.
>


RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
A few of these things concern me... let's dig inline...

But I've knocked off every

 apache -k runservice

It's dead - this is expected.

See the latest set of windows.html, win_service, win_compiling
for what is probably my last set of edits to 1.3.13-dev.
 

> From: Andrew Braund [mailto:abraund_news@mail.com]
> Sent: Saturday, June 10, 2000 7:34 PM
> 
> More testing on windows;
> 
> Summary; 1.3.13 ROCKS

Good to hear.

> Details;
> 
> Some more testing on WinNT4, Win2000, Win95, Win98;
> 
> Compiled with http_main.c service.h and service.c from the web cvs 
> 20000610 2pm +930.
> 
> mod_status.c, mod_info.c, mod_rewrite.c, mod_proxy.c enabled,
> PHP as external script processor.
> 
> Testing on Win NT4 SP6a;
> 
> apache -v
> Server version: Apache/1.3.13-dev-cvs 20000610140000 (Win32)
> Server built:   Jun 10 2000 14:28:17
> 
> apache
> apache -i
>   installs default Apache service
> apache -k start
>   runs console
> apache -n apache -k start
>   runs as service
> apache -u
> apache -k stop
> apache -i -n "apsvc"
> apache -i -n "apsvc" -f "\my server\conf\my.conf"
> apache -u -n "apsvc"
> apache -n "apsvc" -t
> apache -n "apsvc"
> apache -n "apsvc" -k start
> apache -n "apsvc" -k restart
>   (when apache was stopped will start it)

The above is an interesting -side effect-, not an intended behavior.
I don't see a reason to make any special provision, however.

> apache -n "apsvc" -k shutdown
> apache -n "apsvc" -k stop
> NET START "apsvc"
> NET STOP "apsvc"
> start and stop from control panel service applet
> 
> All of the above worked correctly (served pages, status, 
> info, PHP and proxy).
> 
> 
> Testing on Win 2000 5.00.2195;
> 
> apache -v
> Server version: Apache/1.3.13-dev-service9x.200006091127 (Win32)
> Server built:   Jun 10 2000 13:26:09
> 
> apache
>   First impression was that Ctrl-C does not seem to to shutdown
>   Apache, apache -k stop in another dos window closes it down
>   quickly. Further testing revealed that this was due to the new
>   way the command prompt window works, it has a select mode and an edit
>   mode, unless you are in edit mode apache does not get the Ctrl-C.

I don't like this, can someone with VC, 2000 and a little experience with
SetConsoleControlHandler play with this?  I'm expecting that SetConsoleMode
is a little different, perhaps they have changed defaults...  I am seriously
convinced that the console mode support has been frequently changed by M$
to seriously cripple console apps on Win32.

> apache -i
>   installs default Apache service
>   Win2k has a dependencies tab in properties for a service but it
>   does not show Apache to be dependent upon anything (even when started).

I don't like... can you review the registry under the key

HKLM\system\currentcontrolset\services\apache for the depends keys?

I'm suspecting that the tab reflects dependency 'groups', as opposed
to individual dependent apps.

> apache -k start
>   runs console
> apache -n apache -k start
>   runs as service
> apache -u
> apache -k stop
> 
> apache -i -n "apache web server"
> apache -i -n "apache web server" -f "\my server\conf\my.conf"
> apache -u -n "apache web server"
> apache -n "apache web server" -t
> apache -n "apache web server"
> apache -n "apache web server" -k start
> apache -n "apache web server" -k restart
>   if there is an syntax error in the httpd.conf file, a restart will
>   give an appropriate error message and leave the existing server running.

This might be the best behavior... at least they don't kill the server
permanantly, and can keep it running till the error is corrected.

> apache -n "apache web server" -k restart
>   (when apache was stopped will start it)

again, a side-effect

> apache -n "apache web server" -k shutdown
> apache -n "apache web server" -k stop
> NET START "apache web server"
> NET STOP "apache web server"
> start and stop from control panel service applet
> 
> All of the above worked correctly (served pages, status, 
> info, PHP and proxy).
> 
> 
> Testing on Windows 95 4.00.950;
> 
> apache
> apache -i
> apache -i
>   with an error in the httpd.conf file gives descriptive 
> error message.
> apache -k start
>   runs console
> apache -n apac -k start
>   [Sun Jun 11 09:17:45 2000] [error] Service "apac" is not installed!
>   
> apache -n apache -k start
> apache -n apache -k restart
> apache -k shutdown
> apache -k restart
>   when stoped;
>   Cannot read apache PID file c:/serverroot/logs/httpd.pid
>   and apache does not start.

This is actually the anticipated behavior.  Nothing in the restart
syntax is ment to imply that restart starts the server if it is
not yet running.

> apache -k stop
> apache -u
>   if already uninstalled gives;
>   [Sun Jun 11 08:20:34 2000] [error] Service "Apache" is not 
> installed!
> 
> Windows shuts down normally even when Apache is running in 
> the background.
> 
> All of the above worked correctly (served pages, status, 
> info, PHP and proxy).
> 
> 
> Testing on Windows 98 4.10.1998; (two different boxes)
> 
> apache
> apache -i
> apache -i
>   when already installed gives;
>   [Sun Jun 11 09:43:25 2000] [error] Service "Apache" is 
> already installed!
> 
> apache -k runservice
>   Cannot read apache PID file c:/serverroot/logs/httpd.pid
> apache -k start
>   runs console
> apache -n apache -k start
> apache -k shutdown
> apache -k stop
> Windows shuts down normally even when Apache is running in 
> the background.
> All of the above worked correctly (served pages, status, 
> info, PHP and proxy
> including CONNECT).
> 
> apache -u
> apache -u
>   if already uninstalled gives;
>   [Sun Jun 11 09:48:38 2000] [error] Service "Apache" is not 
> installed!
> 
> Windows shuts down normally even when Apache is running in 
> the background.
> 
> 
> Regards
> Andrew Braund

And a warm thank you to yourself, for all you efforts testing these fixes.
 

Re: [patch 1.3.13-dev] Win9x Services

Posted by Greg Stein <gs...@lyra.org>.
Just raising the question, boys... :-)

Maybe there hasn't been a lot of total change, but I have certainly lost
track of what has happened in there (and I'd guess some others have, too). I
figured that the question at least needed to be asked.

Please don't let me interrupt you :-)

Cheers,
-g

On Mon, Jun 12, 2000 at 08:15:01AM -0500, William A. Rowe, Jr. wrote:
> > From: Rodent of Unusual Size [mailto:Ken.Coar@Golux.Com]
> > Sent: Monday, June 12, 2000 5:54 AM
> > 
> > Greg Stein wrote:
> > > 
> > > You know... I'm starting to get the feeling that all of this work
> > > and revamp on the 1.3 branch is a bit much. Is this much change
> > > really a good thing?
> > 
> > If it will reduce the 'DOS window' mail message load without
> > destabilising anything, yes, it is unquestionably a good thing.
> > 
> > I'm not at all sure that there's really that much 'work and revamp'
> > involved.  A lot of message traffic and experimentation, but
> > how much is actually going into the code?
> > 
> > > Especially for the non-Win32 stuff? (i.e. that missing #ifdef WIN32)
> > 
> > Maybe I've missed something, but I haven't seen any of that.
> > 
> > And if someone wants to work on 1.3, knowing it's tending toward
> > quiescence, let him.  If it closes a PR, it's worth it.
> 
> And if it makes 2.0 stable, give it a rest...
> 
> Last time I looked, the 1.3.x codepath -is- beta quality code
> for the Win32 platform.  Of course the main codepath is golden,
> ergo my first message.
> 
> You have far too few coders who know much of both codepaths
> (1.3.x and 2.0)... don't make them angry :-)
> 
> Yours,
> 
> Bill

-- 
Greg Stein, http://www.lyra.org/

RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
> From: Rodent of Unusual Size [mailto:Ken.Coar@Golux.Com]
> Sent: Monday, June 12, 2000 5:54 AM
> 
> Greg Stein wrote:
> > 
> > You know... I'm starting to get the feeling that all of this work
> > and revamp on the 1.3 branch is a bit much. Is this much change
> > really a good thing?
> 
> If it will reduce the 'DOS window' mail message load without
> destabilising anything, yes, it is unquestionably a good thing.
> 
> I'm not at all sure that there's really that much 'work and revamp'
> involved.  A lot of message traffic and experimentation, but
> how much is actually going into the code?
> 
> > Especially for the non-Win32 stuff? (i.e. that missing #ifdef WIN32)
> 
> Maybe I've missed something, but I haven't seen any of that.
> 
> And if someone wants to work on 1.3, knowing it's tending toward
> quiescence, let him.  If it closes a PR, it's worth it.

And if it makes 2.0 stable, give it a rest...

Last time I looked, the 1.3.x codepath -is- beta quality code
for the Win32 platform.  Of course the main codepath is golden,
ergo my first message.

You have far too few coders who know much of both codepaths
(1.3.x and 2.0)... don't make them angry :-)

Yours,

Bill

Re: [patch 1.3.13-dev] Win9x Services

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Greg Stein wrote:
> 
> You know... I'm starting to get the feeling that all of this work
> and revamp on the 1.3 branch is a bit much. Is this much change
> really a good thing?

If it will reduce the 'DOS window' mail message load without
destabilising anything, yes, it is unquestionably a good thing.

I'm not at all sure that there's really that much 'work and revamp'
involved.  A lot of message traffic and experimentation, but
how much is actually going into the code?

> Especially for the non-Win32 stuff? (i.e. that missing #ifdef WIN32)

Maybe I've missed something, but I haven't seen any of that.

And if someone wants to work on 1.3, knowing it's tending toward
quiescence, let him.  If it closes a PR, it's worth it.
-- 
#ken    P-)}

Ken Coar                    <http://Golux.Com/coar/>
Apache Software Foundation  <http://www.apache.org/>
"Apache Server for Dummies" <http://Apache-Server.Com/>
"Apache Server Unleashed"   <http://ApacheUnleashed.Com/>

RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
> -----Original Message-----
> From: Greg Stein [mailto:gstein@lyra.org]
> Sent: Monday, June 12, 2000 3:16 AM
> To: new-httpd@apache.org
> Subject: Re: [patch 1.3.13-dev] Win9x Services
> 
> 
> You know... I'm starting to get the feeling that all of this 
> work and revamp
> on the 1.3 branch is a bit much. Is this much change really a 
> good thing?
> What kind of destabilization are we going to see?
> 
> Especially for the non-Win32 stuff? (i.e. that missing #ifdef WIN32)

In reference to your question... (that missing #ifdef last night)...

@@ -6825,12 +6864,14 @@
         clean_parent_exit(0);
     }
 
-    /* Treat -k start confpath as just -f confpath */
+#ifdef WIN32
+    /* Non-service Signals.  (Ignore -k start for now [with or without -n arg]) */
     if (signal_to_send && strcasecmp(signal_to_send, "start")) {
         send_signal(pconf, signal_to_send);
         clean_parent_exit(0);
     }
-    
+#endif

Hmmm... Looks like this was an -existing- issue.

Interesting, that.  Seems code changes sometimes clean up old badness :-)

Re: [patch 1.3.13-dev] Win9x Services

Posted by Greg Stein <gs...@lyra.org>.
You know... I'm starting to get the feeling that all of this work and revamp
on the 1.3 branch is a bit much. Is this much change really a good thing?
What kind of destabilization are we going to see?

Especially for the non-Win32 stuff? (i.e. that missing #ifdef WIN32)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

RE: [patch 1.3.13-dev] Win9x Services

Posted by Andrew Braund <ab...@mail.com>.
> -----Original Message-----
> From: William A. Rowe, Jr. [mailto:wrowe@lnd.com]
> Sent: Monday, 12 June 2000 15:57
> To: new-httpd@apache.org
> Subject: RE: [patch 1.3.13-dev] Win9x Services
>
>
> > From: Andrew Braund [mailto:abraund_news@mail.com]
> > Sent: Monday, June 12, 2000 12:59 AM
> >
> > > -----Original Message-----
> > > From: William Rowe [mailto:wrowe@megsinet.net]On Behalf Of
> > William A. Rowe, Jr.
> > > Sent: Monday, 12 June 2000 13:06
> > > To: new-httpd@apache.org
> > > Subject: RE: [patch 1.3.13-dev] Win9x Services
> > >
> > >  Try using mode 0x87 and see if that
> > > solves the problem.
> >
> > YES!
> > Left click in the window no longer has any effect. ctrl+c
> > always gives CTRL+C
> > signal.
> >
> > 0x0087 - no select, no mouse move events
>
> Ok... what about 0x07 (0x80 bit is _totally_ undocumented!)

NOPE!

With 0x07 mode a left click puts the command prompt window into select mode
and clicking X (window close) is ignored as described immediately below;

>
> > When in select mode the X (window close) gives "win can not shut
> this window", I click
> > cancel, then when command prompt goes back into edit mode ie press a key or
> > right click in the window, then the window gets the close and testconsole
> > terminates but command prompt window does not close as it usually does.
>
> Then this -doesn't- happen with the 0x87 flag set, correct?

Yes.
With 0x87 left clicking in the window has no effect (other than giving
focus if it didn't have it)
ctrl+c generates CTRL+C signal and clicking X generates CLOSED Signalled,
the testconsole app does its 4 second countdown and terminates,
the command prompt window then exits and disappears.

> Only
> if we throw bits that allow the 'select' behavior?  Then if I can
> consistently throw the input mode to 0x07, we should be really
> hopping!  (assuming the absense of a reserved bit doesn't bite us :-)
>
> Bill
>


RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
> From: Andrew Braund [mailto:abraund_news@mail.com]
> Sent: Monday, June 12, 2000 12:59 AM
> 
> > -----Original Message-----
> > From: William Rowe [mailto:wrowe@megsinet.net]On Behalf Of 
> William A. Rowe, Jr.
> > Sent: Monday, 12 June 2000 13:06
> > To: new-httpd@apache.org
> > Subject: RE: [patch 1.3.13-dev] Win9x Services
> >
> >  Try using mode 0x87 and see if that
> > solves the problem.
> 
> YES!
> Left click in the window no longer has any effect. ctrl+c 
> always gives CTRL+C
> signal.
> 
> 0x0087 - no select, no mouse move events

Ok... what about 0x07 (0x80 bit is _totally_ undocumented!)

> When in select mode the X (window close) gives "win can not shut this window", I click
> cancel, then when command prompt goes back into edit mode ie press a key or
> right click in the window, then the window gets the close and testconsole
> terminates but command prompt window does not close as it usually does.

Then this -doesn't- happen with the 0x87 flag set, correct?  Only
if we throw bits that allow the 'select' behavior?  Then if I can
consistently throw the input mode to 0x07, we should be really
hopping!  (assuming the absense of a reserved bit doesn't bite us :-)

Bill

RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
I have built into the following patch two more key points...

1) The flag to set console mode is tripped to 0x87 under NT.  This 
   provides the best behavior under WinNT ports, and prevents ctrl+c 
   and generally assures a console window behaves as expected.
   Andrew, this should solve the Win2000 window problems for good.

2) The win32 specific _variables_ are wrapped, and the code path is
   more clearly defined, based on Greg Stein's feedback.  These are 
   tighter code and restrictions than the 1.3.12 release.  Note this
   does not affect non-threaded implementations, nor did it ever.

This is a harsh patch, stripping win32 main() vars from other platforms.
This will announce if there is any unwrapped code in main() that
deals specifically with Win32.  It should be compiled under one unix 
(any non-threaded, just to assure that it's still unaffected), and the 
threaded OS2 and Netware ports before it is committed, to assure the 
protections were correctly applied.  Mike, would you check NW?

> -----Original Message-----
> From: William A. Rowe, Jr. [mailto:wrowe@lnd.com]
> Sent: Monday, June 12, 2000 1:57 AM
> To: new-httpd@apache.org
> Subject: RE: [patch 1.3.13-dev] Win9x Services
> 
> 
> OK... wrapping what I've gleaned from Andrew's experiments
> on Win2K, and Ryan's assertions on what it aught to do, this
> is actually a simplification patch.
> 
> But - it involves a heavy overhaul of the send_signal_to_service()
> path, so I've tossed it to Andrew, I'll be testing heavily myself,
> and wanted to throw it to the list -first-.
> 
> I'll commit if the two of us find no problems, unless there are
> objections to the list when I get to it late Monday night.
> 
> But I think all WinNT service people (esp. Keith) will appreciate
> one little aspect it solves
> 
> 1) codify all service control *except 9x -k start* into the
>    send_signal_to_service() func.
> 
> 2) actually wait and report on the success of -k shutdown of a
>    Win9x service.
> 
> 3) don't require loading the httpd.conf file for -k shutdown of
>    a Win9x service (finds the hidden service window and it's pid,
>    instead.  And yes, I know the prototype of an http_main func
>    in service.c is badness, I'll move it into the correct .h
>    before I commit anything :-)
> 
> 4) and finally, just for Keith and company, -k restart actually
>    'restarts' the win32 server.  Not stop, then restart, but really
>    takes the graceful road :-)
> 
> 5) oh, it also fixes a wandering bit of win32 badness that traveled
>    into the http_main.c common code path... I will clean that up now.

So... 5) didn't travel, it was never wrapped in the first place.  Although
that is committed, this version codifies all the Win32 codepath protection.

RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
The cleanup, of course, conflicted the patch :-/

Here's the clean patch, plus the .zip for win32 users without
the patch util.

> From: William A. Rowe, Jr. [mailto:wrowe@lnd.com]
> Sent: Monday, June 12, 2000 1:57 AM
> 
> OK... wrapping what I've gleaned from Andrew's experiments
> on Win2K, and Ryan's assertions on what it aught to do, this
> is actually a simplification patch.
> 
> But - it involves a heavy overhaul of the send_signal_to_service()
> path, so I've tossed it to Andrew, I'll be testing heavily myself,
> and wanted to throw it to the list -first-.
> 
> I'll commit if the two of us find no problems, unless there are
> objections to the list when I get to it late Monday night.
> 
> But I think all WinNT service people (esp. Keith) will appreciate
> one little aspect it solves
> 
> 1) codify all service control *except 9x -k start* into the
>    send_signal_to_service() func.
> 
> 2) actually wait and report on the success of -k shutdown of a
>    Win9x service.
> 
> 3) don't require loading the httpd.conf file for -k shutdown of
>    a Win9x service (finds the hidden service window and it's pid,
>    instead.  And yes, I know the prototype of an http_main func
>    in service.c is badness, I'll move it into the correct .h
>    before I commit anything :-)
> 
> 4) and finally, just for Keith and company, -k restart actually
>    'restarts' the win32 server.  Not stop, then restart, but really
>    takes the graceful road :-)
> 
> 5) oh, it also fixes a wandering bit of win32 badness that traveled
>    into the http_main.c common code path... I will clean that up now.

5 is already committed

RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
OK... wrapping what I've gleaned from Andrew's experiments
on Win2K, and Ryan's assertions on what it aught to do, this
is actually a simplification patch.

But - it involves a heavy overhaul of the send_signal_to_service()
path, so I've tossed it to Andrew, I'll be testing heavily myself,
and wanted to throw it to the list -first-.

I'll commit if the two of us find no problems, unless there are
objections to the list when I get to it late Monday night.

But I think all WinNT service people (esp. Keith) will appreciate
one little aspect it solves

1) codify all service control *except 9x -k start* into the
   send_signal_to_service() func.

2) actually wait and report on the success of -k shutdown of a
   Win9x service.

3) don't require loading the httpd.conf file for -k shutdown of
   a Win9x service (finds the hidden service window and it's pid,
   instead.  And yes, I know the prototype of an http_main func
   in service.c is badness, I'll move it into the correct .h
   before I commit anything :-)

4) and finally, just for Keith and company, -k restart actually
   'restarts' the win32 server.  Not stop, then restart, but really
   takes the graceful road :-)

5) oh, it also fixes a wandering bit of win32 badness that traveled
   into the http_main.c common code path... I will clean that up now.

Bill

RE: [patch 1.3.13-dev] Win9x Services

Posted by Andrew Braund <ab...@mail.com>.
> -----Original Message-----
> From: William Rowe [mailto:wrowe@megsinet.net]On Behalf Of William A.
> Rowe, Jr.
> Sent: Monday, 12 June 2000 13:06
> To: new-httpd@apache.org
> Subject: RE: [patch 1.3.13-dev] Win9x Services
>
>
> Interesting...
>
> I'm really unclear about the Ctrl+C problem in W2K.  First off, does
> it make a difference in select mode if you hit Ctrl+break instead?

Yes, apache terminates normally with ctrl+break.
If you are in select mode a ctrl+c takes you back
to "edit Mode", a second ctrl+c terminates apache normally.


> Second, is the select mode the *default*?

No

>  Or is it only a problem
> if you accidently *trip* it?

You trip it by clicking in the command prompt window when it already had the
focus.
If the window didn't have the focus, a click gives it the focus but it stays
in "edit mode".
It seems that a left click on a command prompt that has focus will get you into
"select mode". Subsequent left clicks have no effect. A right click will put
the command prompt back to "edit mode".
Typing normal characters, escape, arrow keys (but not ctrl, shift or alt keys)
also gets you back into "edit mode".

>  Or is this ctrl+c the copy command,
> without any option to bypass it?

Ctrl+c when in select mode puts the command prompt window back to "edit mode"
and
clears any highlight you had dragged but doesn't seem to do anything useful
ie the clipboard is left unchanged.
ctrl+insert also exhibits the same useless behaviour.
In order to copy you need to select the text with mouse drag, then hit the
enter key.

>  Try using mode 0x87 and see if that
> solves the problem.

YES!
Left click in the window no longer has any effect. ctrl+c always gives CTRL+C
signal.

0x0087 - no select, no mouse move events
0x008f - same, no mouse move events
0x003f - same and you get mouse move events
0x001f - same and you get mouse move events
0x009f - same and you get mouse move events
0x00af - same, no mouse move events

0x00cf - select behaviour, no mouse move events
0x006f - select behaviour, no mouse move events
0x004f - select behaviour, no mouse move events
0x00bf - select behaviour, no mouse move events

When in select mode the X (window close) gives "win can not shut this window",
I click
cancel, then when command prompt goes back into edit mode ie press a key or
right click in the window, then the window gets the close and testconsole
terminates
but command prompt window does not close as it usually does.


>
> Perhaps we just tell them to use ctrl+break and not mention ctrl+c.
>
> I've noticed win95 is even stranger, mouse events are selected by
> default :-/  No *extra* flags can be toggled (any from mast 0xffc0)
> so there are no legal undocumented flags.  And no flag affects the
> shutdown/close button bug.
>
> One major problem in 95/98 is the lack of any progress message on
> startup/shutdown.  I'm thinking of a timeout'ed wait even on the
> child process, and using the window to determine if the service is
> started.
>
> Basically, we would use the send_signal_to_service call for both
> platform types, but use window enumeration for service control.
> I suppose I can even fix your issue with -k restart not having
> the same side-effect.  And I can stop the service without reading
> the config for the pid file.  This is a MAJOR problem if the user
> tries to start console apache with the service running, since the
> pid file is trashed and the service can't be -k stop'ped.
>
> I've left the hole in the ap_start_console_monitor()'s atexit handler
> so we can pause the console for feedback (direct from the api - can't
> trust the clib at that stage.)  Ideally, that input is the close
> button.  That obviously will not work for 9x.
>
> Those are my thoughts for tonight... perhaps we should take this to
> IRC and hack for a while.  But not tonight :-)
>
> Bill
>


RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
Interesting...

I'm really unclear about the Ctrl+C problem in W2K.  First off, does
it make a difference in select mode if you hit Ctrl+break instead?
Second, is the select mode the *default*?  Or is it only a problem
if you accidently *trip* it?  Or is this ctrl+c the copy command,
without any option to bypass it?  Try using mode 0x87 and see if that 
solves the problem.

Perhaps we just tell them to use ctrl+break and not mention ctrl+c.

I've noticed win95 is even stranger, mouse events are selected by
default :-/  No *extra* flags can be toggled (any from mast 0xffc0)
so there are no legal undocumented flags.  And no flag affects the
shutdown/close button bug.

One major problem in 95/98 is the lack of any progress message on
startup/shutdown.  I'm thinking of a timeout'ed wait even on the
child process, and using the window to determine if the service is
started.  

Basically, we would use the send_signal_to_service call for both 
platform types, but use window enumeration for service control.
I suppose I can even fix your issue with -k restart not having 
the same side-effect.  And I can stop the service without reading 
the config for the pid file.  This is a MAJOR problem if the user
tries to start console apache with the service running, since the
pid file is trashed and the service can't be -k stop'ped.

I've left the hole in the ap_start_console_monitor()'s atexit handler
so we can pause the console for feedback (direct from the api - can't 
trust the clib at that stage.)  Ideally, that input is the close 
button.  That obviously will not work for 9x.

Those are my thoughts for tonight... perhaps we should take this to
IRC and hack for a while.  But not tonight :-)

Bill


RE: [patch 1.3.13-dev] Win9x Services

Posted by Andrew Braund <ab...@mail.com>.
> -----Original Message-----
> From: William A. Rowe, Jr. [mailto:wrowe@lnd.com]
> Sent: Monday, 12 June 2000 6:57
> To: new-httpd@apache.org
> Subject: RE: [patch 1.3.13-dev] Win9x Services
>
>
> > From: Andrew Braund [mailto:abraund_news@mail.com]
> > Sent: Saturday, June 10, 2000 7:34 PM
> >
> > Testing on Win 2000 5.00.2195;
> >
> > apache -v
> > Server version: Apache/1.3.13-dev-service9x.200006091127 (Win32)
> > Server built:   Jun 10 2000 13:26:09
> >
> > apache
> >   First impression was that Ctrl-C does not seem to to shutdown
> >   Apache, apache -k stop in another dos window closes it down
> >   quickly. Further testing revealed that this was due to the new
> >   way the command prompt window works, it has a select mode and an edit
> >   mode, unless you are in edit mode apache does not get the Ctrl-C.
>
> This bugs me -SO MUCH- that I've attached the source for my Win32
> console diagnostics module.  (A simple [cl -c TestConsole.c] and
> [link TestConsole.obj kernel32.lib] will build it.)  You might want
> to see if we get any extra 'bits' in the console mode flag when that
> state is toggled, so that we might override it.
>
> Bill
>
> This code is really for trying (yet again) to grab win95's close
> button... and I'm off to test it there (if you haven't guessed, I
> never installed my email to that boot path).
>
>

# lines starting with # are my comments the rest was copied from
# the command window

# on WinNT4SP6a I get default mode of 0x0087, (on Win2000 0x00ef);
C:\apache-1.3\src>testconsole 0x00ff
Default console mode was 0x0087, mode changed to 0x00ff

Dumping console activity... press Ctrl+Break or Close to terminate.


#all the rest of this testing was done on Win2000

#run testconsole
c:\apache-1.3\src>testconsole 0x00ff
Default console mode was 0x00ef, mode changed to 0x00ff

Dumping console activity... press Ctrl+Break or Close to terminate.

#press n key (just to see if its working!)
Key 0x4e (OEM 0x31) Pressed 1 times for 'n' code 110 (0x6e)
    Console mode is 0x00ff
#release n key
Key 0x4e (OEM 0x31) Released 1 times for 'n' code 110 (0x6e)
# press control key+
Key 0x11 (OEM 0x1d) Pressed 1 times for '?' code 0 (0x00)with
    LeftCtrl
    Console mode is 0x00ff
#press c key
Ignoring CTRL+C signal...
Key 0x43 (OEM 0x2e) Released 1 times for '?' code 3 (0x03)with
    LeftCtrl
    Console mode is 0x00ff
#release control key
Key 0x11 (OEM 0x1d) Released 1 times for '?' code 0 (0x00)
    Console mode is 0x00ff


#click in window, note that unlike winnt we don't get any mouse move events on
Win2k
#window title bar changes from "CommandPrompt -testconsole 0x00ff" to
#"Select CommandPrompt -testconsole 0x00ff"
# press control key
# note nothing happens in window (control key is captured)
# press c key
Key 0x11 (OEM 0x1d) Pressed 1 times for '?' code 0 (0x00)with
    LeftCtrl
    Console mode is 0x00ff
Ignoring CTRL+C signal...
Key 0x43 (OEM 0x2e) Released 1 times for '?' code 3 (0x03)with
    LeftCtrl
    Console mode is 0x00ff




#same again but this time testconsole run without processed input
c:\apache-1.3\src>testconsole 0x00fe
Default console mode was 0x00ef, mode changed to 0x00fe

Dumping console activity... press Ctrl+Break or Close to terminate.

#press control key
Key 0x11 (OEM 0x1d) Pressed 1 times for '?' code 0 (0x00)with
    LeftCtrl
    Console mode is 0x00fe
#press c key
Key 0x43 (OEM 0x2e) Pressed 1 times for '?' code 3 (0x03)with
    LeftCtrl
    Console mode is 0x00fe
#released c key
Key 0x43 (OEM 0x2e) Released 1 times for '?' code 3 (0x03)with
    LeftCtrl
    Console mode is 0x00fe
#released control key
Key 0x11 (OEM 0x1d) Released 1 times for '?' code 0 (0x00)
    Console mode is 0x00fe
#clicked in window
#window title bar changes from "CommandPrompt -testconsole 0x00fe" to
#"Select CommandPrompt -testconsole 0x00fe"
#press control key - nothing happens
#press c key
Key 0x11 (OEM 0x1d) Pressed 1 times for '?' code 0 (0x00)with
    LeftCtrl
    Console mode is 0x00fe
Key 0x11 (OEM 0x1d) Pressed 1 times for '?' code 0 (0x00)with
    LeftCtrl
    Console mode is 0x00fe
#release c key
Key 0x43 (OEM 0x2e) Released 1 times for '?' code 3 (0x03)with
    LeftCtrl
    Console mode is 0x00fe
#release control key
Key 0x11 (OEM 0x1d) Released 1 times for '?' code 0 (0x00)
    Console mode is 0x00fe
#click in notepad window
Command Window Lost Focus
    Console mode is 0x00fe
#click in Command prompt window
Command Window Received Focus
    Console mode is 0x00fe
#clicked again in command prompt window
#window title bar changes from "CommandPrompt -testconsole 0x00fe" to
#"Select CommandPrompt -testconsole 0x00fe"
#no output in command window
#press control key
#(nothing happens)
#press break key
Key 0x11 (OEM 0x1d) Pressed 1 times for '?' code 0 (0x00)with
    LeftCtrl
    Console mode is 0x00fe
Key 0x03 (OEM 0x46) Released 1 times for '?' code 3 (0x03)with
    Enhanced LeftCtrl
    Console mode is 0x00fe
CTRL+BREAK Signalled
4 seconds till termination...
#release break key
#(nothing happens)
3 seconds till termination...
#release control key
Key 0x11 (OEM 0x1d) Released 1 times for '?' code 0 (0x00)
    Console mode is 0x00fe
2 seconds till termination...
1 seconds till termination...

c:\apache-1.3\src>


Hope this helps, anything else I should try?


RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
> From: Andrew Braund [mailto:abraund_news@mail.com]
> Sent: Saturday, June 10, 2000 7:34 PM
> 
> Testing on Win 2000 5.00.2195;
> 
> apache -v
> Server version: Apache/1.3.13-dev-service9x.200006091127 (Win32)
> Server built:   Jun 10 2000 13:26:09
> 
> apache
>   First impression was that Ctrl-C does not seem to to shutdown
>   Apache, apache -k stop in another dos window closes it down
>   quickly. Further testing revealed that this was due to the new
>   way the command prompt window works, it has a select mode and an edit
>   mode, unless you are in edit mode apache does not get the Ctrl-C.

This bugs me -SO MUCH- that I've attached the source for my Win32 
console diagnostics module.  (A simple [cl -c TestConsole.c] and 
[link TestConsole.obj kernel32.lib] will build it.)  You might want
to see if we get any extra 'bits' in the console mode flag when that
state is toggled, so that we might override it.

Bill

This code is really for trying (yet again) to grab win95's close 
button... and I'm off to test it there (if you haven't guessed, I
never installed my email to that boot path).



RE: [patch 1.3.13-dev] Win9x Services

Posted by Andrew Braund <ab...@mail.com>.
> -----Original Message-----
> From: William A. Rowe, Jr. [mailto:wrowe@lnd.com]
> Sent: Saturday, 17 June 2000 11:40
> To: new-httpd@apache.org; new-httpd@apache.org; new-httpd@apache.org
> Subject: RE: [patch 1.3.13-dev] Win9x Services
>
>
> Good news, overall :)
>
> I think we have the ultimate solution to the 3rd party enhancements,
> other's interest in being able to install/remove services, and so on.
> I'm just hoping we see a good place to document the new system
> --ntservice argument without confusing beginning users.  Feel free to
> test, but I'm certain from my NT tests that the non-flag, no hack
> version will perform as expected under any Windows without fault.
>
> So that is a worthwhile flag even under Win2000... I'll remember that,
> even if it's never used in Apache, and I thank you again for beating
> up the server for all of us :)
>
> on to the Apache 2.0 cleanup...
>
> Bill
>
> > -----Original Message-----
> > From: Andrew Braund [mailto:abraund_news@mail.com]
> > Sent: Friday, June 16, 2000 8:48 PM
> > To: new-httpd@apache.org
> > Subject: RE: [patch 1.3.13-dev] Win9x Services
> >
> >
> >   Win2k dependencies tab in properties for  service
> >   does not show Apache to be dependent upon anything (even when
> >   started).
>
> Hmmm... what's up with that... you did say that it won't show
> dependencies if you add yet another module either?  Sounds like a
fluke (or a flag
> hidden to prevent the user from viewing/removing critical components.
> Maybe this is a good thing :)

Win2000 Services:properties:Dependancies tab does not show any
dependancies at all for Apache service.
The area in the tab titled;
"apache web server" depends on these services
contains;
- <No Dependancies>
and below that a second area titled;
These services depend on "apache web server"
contains;
- <No Dependancies>


The only time I get entries in these "depends on" areas was when I add
another "real" service ie something that appears an an entry when you
display the services on a machine.
e.g. if I add lanmanworkstation as a DependsOnService registry entry in
the apache key, then the
"Apache web server" depends on these services
box in Dependencies tab of Apache service shows
- Workstation
(which is the DisplayName entry for lanmanworkstation).

The note in the Dependencies tab reads;
"Some services depend on other services. If a service is stopped
or is not running properly, dependent services can be affected."

I think that the dependancies tab is intended to indicate only
"Services" that are dependancies as these are the only things the
administrator has control over using the GUI services manager. The
logic being that if you can't control the dependency by the GUI
(services applet) then don't show the dependancy (such as Tcpip or Afd)
in the GUI (services:properties:Dependancies tab).

>  But since I'll be adding
> several modules
> to the list (workstation and dcom services) that the user can
> customize,
> I'm really, really curious.

I expect that when Apache adds workstation (ie "lanmanworkstation" in
DependsOnService key) it will show up in the dependancies tab.

>
> > All of the above worked correctly (served pages, status,
> info, PHP and
> > proxy).
>
> Very good news.
>


RE: [patch 1.3.13-dev] Win9x Services

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
Good news, overall :)

I think we have the ultimate solution to the 3rd party enhancements,
other's interest in being able to install/remove services, and so on.
I'm just hoping we see a good place to document the new system 
--ntservice argument without confusing beginning users.  Feel free to
test, but I'm certain from my NT tests that the non-flag, no hack
version will perform as expected under any Windows without fault.

So that is a worthwhile flag even under Win2000... I'll remember that,
even if it's never used in Apache, and I thank you again for beating
up the server for all of us :)

on to the Apache 2.0 cleanup...

Bill

> -----Original Message-----
> From: Andrew Braund [mailto:abraund_news@mail.com]
> Sent: Friday, June 16, 2000 8:48 PM
> To: new-httpd@apache.org
> Subject: RE: [patch 1.3.13-dev] Win9x Services
> 
> 
>   Win2k dependencies tab in properties for  service
>   does not show Apache to be dependent upon anything (even when
>   started).

Hmmm... what's up with that... you did say that it won't show dependencies
if you add yet another module either?  Sounds like a fluke (or a flag 
hidden to prevent the user from viewing/removing critical components.
Maybe this is a good thing :)  But since I'll be adding several modules
to the list (workstation and dcom services) that the user can customize,
I'm really, really curious.

> All of the above worked correctly (served pages, status, info, PHP and
> proxy).

Very good new.