From http://chenergan.iteye.com/blog/184470
In the Apache/bin subdirectory, run the following command to install Apache as a Windows NT Service:
Httpd-K install
To specify the service name, use the following command. When You Install Multiple Apache services on the same machine, you must specify different names for them.
Httpd-K install-n "service name"
If you want to use different configuration files for services with different names, you must specify the configuration file during installation:
Httpd-K install-n "service name"-F "C: \ files \ My. conf"
If you are using the first command, that is, there are no other command line parameters except-K install, the installed Service name will be: apache2.2, the configuration file will use conf \ httpd. conf.
It is easy to remove an apache service:
Httpd-K uninstall
Alternatively, run the following command to remove the apache service with a specific name:
Httpd-K uninstall-n "service name"
Generally, the apache service monitor tool is used to start, restart, and shut down the apache service. You can also use the Console Commands: Net start apache2.2 and net stop apache2.2 or use the Windows Service Control Panel.
Before starting the apache service, you should use the following command Check whether the configuration file is correct. :
Httpd-n "service name"-T
You can use the command line switch to control the apache service. To start an installed apache service, you can use:
Httpd-K start
To stop an installed apache service, you can use:
Httpd-K stop
Or
Httpd-K shutdown
To restart a running Apache service and force it to re-read the configuration file, you can use:
Httpd-K restart
By default, the apache service is registered as a local system user (LocalSystem account. LocalSystem accounts have no network permissions and cannot access the network through any Windows security mechanism, including file systems, named pipelines, DCOM, or secure RPC, but they have extensive privileges for local resources.
use the httpd-H command to view more commands