While working with a JDE EnterpriseOne add-on application, I needed to install the Apache HTTP Server as a Windows Service so that it would start automatically when rebooted. The command I used is:
httpd.exe -k install -n "MyHTTPServer_WindowsServiceName"
I got it from this Apache HTTP Server documentation:
The relevant test is:
You can install Apache as a Windows NT service as follows from the command prompt at the Apache bin subdirectory:
httpd.exe -k install
If you need to specify the name of the service you want to install, use the following command. You have to do this if you have several different service installations of Apache on your computer. If you specify a name during the install, you have to also specify it during any other -k operation.
httpd.exe -k install -n “MyServiceName”
If you need to have specifically named configuration files for different services, you must use this:
httpd.exe -k install -n “MyServiceName” -f “c:\files\my.conf”
If you use the first command without any special parameters except -k install, the service will be called Apache2.4 and the configuration will be assumed to be conf\httpd.conf.