If you have a server running Apache and PHP with XAMPP, or you simply have installed a web server on your PC and you want to start Apache automatically as service in Windows you need to do the following steps :
1. First step to install Apache service, run XAMPP Control Panel as Administrator, then click the Apache service button located on the left side of Apache components, click next and “Click Yes to Install the Apache Service” window will open, then click Yes to continue.
2. Second step you have installed apache service on your Windows PC, but it is not running automatically so you have to run it manually. So to run it automatically open XAMPP Control Panel and click START button on Apache component.
3. To remove/uninstall Apache Service run XAMPP Control Panel as Administrator, stop the Apache service, then click the Apache service button located on the left side of Apache components, uncheck the install service button and that’s it .
To make Apache work faster uncomment the “127.0.0.1 localhost” line from c:\windows\system32\drivers\etc\hosts file .
Good luck !