This blog post will explain how to setup Windows to start the Apache web server as a service. Before Apache is installed, it would be a good idea to check the httpd.conf file and make sure that these four variables are correct: ServerRoot, Listen, DocumentRoot, and ServerName. Open a Windows command prompt as an administrator and navigate to the Apache directory. Type these commands below to install Apache as a Windows service.
httpd -k install
httpd -k start
In case Apache has to be shut down, type this command below.
httpd -k stop
In case Apache has to be uninstalled from the services list.
httpd -k uninstall
