httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject RE: Tip for 2.0 Win32 Service code.
Date Fri, 16 Jun 2000 19:27:45 GMT
> From: []
> Sent: Friday, June 16, 2000 2:44 AM
> >  I strongly suggest that this flag, an (just like the -Z 
> >  child proc arg) never be returned in a -h list.
> Yes... but you better document it real good since that 'special'
> startup string won't be visible anywhere on the GUI and if 
> someone gets the bright idea they can write a down and dirty
> installation program for Win32 Apache they are going to have to 
> know about the 'secret' Service start parameter(s).

Good point.  Gentlefolk, where do you propose this --ntservice
flag should be documented for hackers to avoid? 

The --ntservice argument to Apache 1.3.13 and greater will call 
the Windows NT Service Control Manager to start Apache as an NT 
service.  *Only* the Windows NT SCM may invoke Apache with this 
option, and it must be the only argument.  If Apache is started
by another process with the --ntservice option, it will fail.
In version 2.0, we expect that this flag may be required.  For 
1.3.9, Apache.exe performs an AllocConsole test if no arguments 
are passed, and if a console can be allocated it calls the SCM.

If you are creating a service installation program for Apache,
use the quoted, full path to Apache.exe followed by the 
"--ntservice", option for the lpBinaryPathName argument to the 
Win32 API CreateService() call.  For example;

  CreateService(..., "\"C:\Apache\Apache.exe\" --ntservice", ...)

Note that Apache versions prior to 1.3.13 ignore all command
line arguments, including the --ntservice flag.  They will start 
successfully with that flag present, but it has no effect to
bypass the AllocConsole() test.

View raw message